1 ; RUN: opt -S -O2 -enable-gvn-hoist < %s | FileCheck %s
3 ; Check that the inlined loads are hoisted.
4 ; CHECK-LABEL: define i32 @fun(
6 ; CHECK: load i32, i32* @A
9 @A = external global i32
10 @B = external global i32
11 @C = external global i32
14 %a = load i32, i32* @A
18 define i32 @fun(i1 %c) {
20 br i1 %c, label %if.then, label %if.else
24 %call1 = call i32 @loadA()
30 %call2 = call i32 @loadA()
35 %ret = phi i32 [ %call1, %if.then ], [ %call2, %if.else ]