1 ; RUN: opt -passes=gvn -S < %s | FileCheck %s
3 ; CHECK: define {{.*}}@eggs
5 %struct.zot = type { ptr }
6 %struct.wombat = type { ptr }
7 %struct.baz = type { i8, ptr }
9 @global = hidden unnamed_addr constant ptr @quux
13 define hidden void @eggs(ptr %arg, i1 %arg2, ptr %arg3, i32 %arg4, ptr %arg5) unnamed_addr align 2 {
15 %tmp = alloca %struct.wombat, align 8
16 store ptr @global, ptr %arg, align 8, !invariant.group !0
17 br i1 %arg2, label %bb4, label %bb2
20 %tmp3 = atomicrmw sub ptr %arg3, i32 %arg4 acq_rel, align 4
23 bb4: ; preds = %bb2, %bb
24 %tmp5 = load ptr, ptr %arg5, align 8
25 %tmp6 = getelementptr inbounds %struct.baz, ptr %tmp5, i64 0, i32 1
26 br i1 %arg2, label %bb9, label %bb7
29 %tmp8 = tail call ptr @f()
32 bb9: ; preds = %bb7, %bb4
33 %tmp10 = load ptr, ptr %arg5, align 8
34 %tmp13 = load ptr, ptr %arg, align 8, !invariant.group !0
35 %tmp15 = load ptr, ptr %tmp13, align 8
36 tail call void %tmp15(ptr %arg, i1 %arg2)
37 %tmp17 = load ptr, ptr %tmp, align 8
38 %tmp18 = icmp eq ptr %tmp17, null
42 ; Function Attrs: nounwind willreturn
43 declare hidden void @quux(ptr, i1) unnamed_addr #0 align 2
45 attributes #0 = { nounwind willreturn }