1 ; RUN: opt -disable-output -passes="loop-mssa(loop-rotate),print<memoryssa>" -verify-memoryssa < %s 2>&1 | FileCheck %s
4 ; CHECK-NEXT: 3 = MemoryDef(liveOnEntry)
5 ; CHECK-NEXT: store ptr null, ptr %p, align 8
6 ; CHECK-NEXT: MemoryUse(3)
7 ; CHECK-NEXT: %val11 = load ptr, ptr %p, align 8
10 ; CHECK-NEXT: 5 = MemoryPhi({loop.latch,1},{loop.latch.lr.ph,3})
11 ; CHECK-NEXT: MemoryUse(5)
12 ; CHECK-NEXT: %val2 = load ptr, ptr %p, align 8
13 ; CHECK-NEXT: 1 = MemoryDef(5)
14 ; CHECK-NEXT: store ptr null, ptr %p, align 8
15 ; CHECK-NEXT: MemoryUse(1)
16 ; CHECK-NEXT: %val1 = load ptr, ptr %p, align 8
19 ; CHECK-NEXT: 4 = MemoryPhi({entry,3},{loop.exit_crit_edge,1})
21 define void @test(ptr %p) {
26 store ptr null, ptr %p
27 %val1 = load ptr, ptr %p
28 %cmp = icmp eq ptr %val1, null
29 br i1 %cmp, label %exit, label %loop.latch
32 %val2 = load ptr, ptr %p