1 ; RUN: opt -disable-output -aa-pipeline=basic-aa -passes='loop-mssa(licm),print<memoryssa>' < %s 2>&1 | FileCheck %s
2 target triple = "x86_64-unknown-linux-gnu"
5 ; CHECK: 5 = MemoryPhi(
6 ; CHECK-NOT: 7 = MemoryPhi(
7 @v_67 = external dso_local global i32, align 1
8 @v_76 = external dso_local global i16, align 1
9 @v_86 = external dso_local global ptr, align 1
11 define dso_local void @main() {
13 %v_59 = alloca i16, align 2
16 for.cond: ; preds = %for.body, %entry
17 br i1 undef, label %for.body, label %for.end
19 for.body: ; preds = %for.cond
20 store i16 undef, ptr %v_59, align 2
23 for.end: ; preds = %for.cond
24 br i1 undef, label %if.else568, label %cond.end82
26 cond.false69: ; No predecessors!
29 cond.end82: ; preds = %cond.false69, %cond.true55
30 br i1 undef, label %if.else568, label %land.lhs.true87
32 land.lhs.true87: ; preds = %cond.end82
33 br i1 undef, label %if.then88, label %if.else568
35 if.then88: ; preds = %land.lhs.true87
36 store ptr @v_76, ptr @v_86, align 1
39 if.else568: ; preds = %land.lhs.true87, %cond.end82, %for.end
40 store volatile i32 undef, ptr @v_67, align 1
43 if.end569: ; preds = %if.else568, %if.then88
49 ; CHECK: 7 = MemoryPhi(
50 ; CHECK: 6 = MemoryPhi(
51 ; CHECK: 10 = MemoryPhi(
52 ; CHECK: 9 = MemoryPhi(
53 ; CHECK: 8 = MemoryPhi(
56 %e = alloca i16, align 1
59 lbl1: ; preds = %if.else, %for.end5, %entry
60 store i16 undef, ptr %e, align 1
61 %0 = load i16, ptr %e, align 1
62 %call = call i16 @g(i16 %0)
63 br i1 undef, label %for.end, label %if.else
65 for.end: ; preds = %if.then
66 br i1 true, label %for.cond2, label %lbl2
68 lbl2: ; preds = %for.body4, %if.end
71 for.cond2: ; preds = %lbl3
72 br i1 undef, label %for.body4, label %for.end5
74 for.body4: ; preds = %for.cond2
77 for.end5: ; preds = %for.cond2
78 switch i32 undef, label %unreachable [
79 i32 0, label %if.end12
83 if.else: ; preds = %lbl1
84 switch i32 undef, label %unreachable [
85 i32 0, label %if.end12
89 if.end12: ; preds = %cleanup.cont11s, %cleanup.cont
90 call void @llvm.lifetime.end.p0(i64 1, ptr undef)
93 unreachable: ; preds = %if.else, %for.end5
99 ; Function Attrs: argmemonly nounwind willreturn
100 declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture)