1 ; RUN: opt -passes='print<memoryssa>' -disable-output < %s 2>&1 | FileCheck %s
3 ; FIXME: The %sel2 load should be MemoryUse(4), because it loads the value
4 ; stored by the %sel1 store on the previous iteration.
5 ; CHECK: 1 = MemoryDef(liveOnEntry)
6 ; CHECK-NEXT: store i32 1, ptr %a1, align 4
7 ; CHECK: 2 = MemoryDef(1)
8 ; CHECK-NEXT: store i32 2, ptr %a2, align 4
9 ; CHECK: 4 = MemoryPhi({entry,2},{loop,3})
10 ; CHECK-NEXT: %c = phi i1 [ true, %entry ], [ false, %loop ]
11 ; CHECK: 3 = MemoryDef(4)
12 ; CHECK-NEXT: store i32 0, ptr %sel1, align 4
14 ; CHECK-NEXT: %v = load i32, ptr %sel2, align 4
24 %c = phi i1 [ true, %entry ], [ false, %loop ]
25 %sel1 = select i1 %c, ptr %a1, ptr %a2
26 store i32 0, ptr %sel1
27 %sel2 = select i1 %c, ptr %a2, ptr %a1
28 %v = load i32, ptr %sel2