1 ; RUN: opt -disable-output -licm -enable-new-pm=0 -print-memoryssa < %s 2>&1 | FileCheck %s
2 ; RUN: opt -disable-output -aa-pipeline=basic-aa -passes='loop-mssa(licm),print<memoryssa>' < %s 2>&1 | FileCheck %s
7 ; CHECK-NEXT: ; [[NO4:.*]] = MemoryPhi({entry,liveOnEntry},{lbl1.backedge,[[NO9:.*]]})
8 ; CHECK-NEXT: ; [[NO2:.*]] = MemoryDef([[NO4]])
9 ; CHECK-NEXT: call void @g()
10 ; CHECK-NEXT: br i1 undef, label %for.end, label %if.else
13 ; CHECK-NEXT: br i1 undef, label %lbl3, label %lbl2
16 ; CHECK-NEXT: ; [[NO8:.*]] = MemoryPhi({lbl3,[[NO7:.*]]},{for.end,[[NO2]]})
17 ; CHECK-NEXT: br label %lbl3
20 ; CHECK-NEXT: [[NO7]] = MemoryPhi({lbl2,[[NO8]]},{for.end,2})
23 ; CHECK-NEXT: MemoryUse([[NO7]])
24 ; CHECK-NEXT: %cleanup.dest = load i32, i32* undef, align 1
26 ; CHECK: lbl1.backedge:
27 ; CHECK-NEXT: [[NO9]] = MemoryPhi({cleanup,[[NO7]]},{if.else,2})
28 ; CHECK-NEXT: br label %lbl1
30 ; CHECK: cleanup.cont:
31 ; CHECK-NEXT: ; [[NO6:.*]] = MemoryDef([[NO7]])
32 ; CHECK-NEXT: store i16 undef, i16* %e, align 1
33 ; CHECK-NEXT: 3 = MemoryDef([[NO6]])
34 ; CHECK-NEXT: call void @llvm.lifetime.end.p0i8(i64 1, i8* null)
38 %e = alloca i16, align 1
41 lbl1: ; preds = %if.else, %cleanup, %entry
42 store i16 undef, i16* %e, align 1
44 br i1 undef, label %for.end, label %if.else
46 for.end: ; preds = %lbl1
47 br i1 undef, label %lbl3, label %lbl2
49 lbl2: ; preds = %lbl3, %for.end
52 lbl3: ; preds = %lbl2, %for.end
53 br i1 undef, label %lbl2, label %cleanup
55 cleanup: ; preds = %lbl3
56 %cleanup.dest = load i32, i32* undef, align 1
57 %switch = icmp ult i32 %cleanup.dest, 1
58 br i1 %switch, label %cleanup.cont, label %lbl1
60 cleanup.cont: ; preds = %cleanup
61 call void @llvm.lifetime.end.p0i8(i64 1, i8* null)
64 if.else: ; preds = %lbl1
70 ; Function Attrs: argmemonly nounwind willreturn
71 declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture)