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, ptr @A
9 @A = external global i32
10 @B = external global i32
11 @C = external global i32
12 @D = external global i32
13 @E = external global i32
20 define i32 @fun(i1 %c) {
22 br i1 %c, label %if.then, label %if.else
26 %call1 = call i32 @loadA()
32 %call2 = call i32 @loadA()
37 %ret = phi i32 [ %call1, %if.then ], [ %call2, %if.else ]