1 ; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>,verify<memoryssa>' -disable-output < %s 2>&1 | FileCheck %s
7 ; (clobbering access - b)
9 ; .... ________________________________
14 ; | ______________________ |
16 ; (starting access) | |
18 ; (clobbering access - a) | |
21 ; | |_______________________| |
23 ; |_________________________________|
25 ; More specifically, one access, with multiple clobbering accesses. One of
26 ; which strictly dominates the access, the other of which has a backedge
28 ; readnone so we don't have a 1:1 mapping of MemorySSA edges to Instructions.
29 declare void @doThingWithoutReading() readnone
30 declare i8 @getValue() readnone
31 declare i1 @getBool() readnone
33 define hidden void @testcase(ptr %Arg) {
35 call void @doThingWithoutReading()
36 %Val.Entry = call i8 @getValue()
37 ; CHECK: 1 = MemoryDef(liveOnEntry)
38 ; CHECK-NEXT: store i8 %Val.Entry
39 store i8 %Val.Entry, ptr %Arg
40 call void @doThingWithoutReading()
44 ; CHECK: 5 = MemoryPhi({Entry,1},{InnerLoop.Tail,3})
45 ; CHECK-NEXT: %Val.Outer =
46 %Val.Outer = call i8 @getValue()
47 ; CHECK: 2 = MemoryDef(5)
48 ; CHECK-NEXT: store i8 %Val.Outer
49 store i8 %Val.Outer, ptr %Arg
50 call void @doThingWithoutReading()
54 ; CHECK: 4 = MemoryPhi({OuterLoop,2},{InnerLoop,3})
55 ; CHECK-NEXT: ; MemoryUse(4)
56 ; CHECK-NEXT: %StartingAccess = load
57 %StartingAccess = load i8, ptr %Arg, align 4
58 %Val.Inner = call i8 @getValue()
59 ; CHECK: 3 = MemoryDef(4)
60 ; CHECK-NEXT: store i8 %Val.Inner
61 store i8 %Val.Inner, ptr %Arg
62 call void @doThingWithoutReading()
63 %KeepGoing = call i1 @getBool()
64 br i1 %KeepGoing, label %InnerLoop.Tail, label %InnerLoop
67 %KeepGoing.Tail = call i1 @getBool()
68 br i1 %KeepGoing.Tail, label %End, label %OuterLoop