1 ; RUN: opt < %s -passes='early-cse<memssa>,gvn-hoist' -earlycse-debug-hash -S | FileCheck %s
3 ; Make sure opt doesn't crash. On top of that, the instructions
4 ; of the side blocks should be hoisted to the entry block.
11 define void @foo(ptr %arg) {
13 %call.idx.val.i = load i32, ptr %arg
17 ;CHECK: %call264 = call zeroext i1 @bar
18 ;CHECK: store i32 %call.idx.val.i, ptr %arg
19 ;CHECK: %0 = getelementptr inbounds %S, ptr %arg, i64 0, i32 0, i32 1
20 ;CHECK: store i64 undef, ptr %0
21 ;CHECK: br i1 %call264, label %bb2, label %bb3
24 %call264 = call zeroext i1 @bar()
25 br i1 %call264, label %bb2, label %bb3
28 ;CHECK-NOT: store i32 %call.idx.val.i, ptr %arg
29 ;CHECK-NOT: store i64 undef, ptr %{.*}
32 store i32 %call.idx.val.i, ptr %arg
33 %0 = getelementptr inbounds %S, ptr %arg, i64 0, i32 0, i32 1
34 store i64 undef, ptr %0
38 ;CHECK-NOT: store i32 %call.idx.val.i, ptr %arg
39 ;CHECK-NOT: store i64 undef, ptr %{.*}
42 store i32 %call.idx.val.i, ptr %arg
43 %1 = getelementptr inbounds %S, ptr %arg, i64 0, i32 0, i32 1
44 store i64 undef, ptr %1
48 declare zeroext i1 @bar()