1 ; RUN: opt -basicaa -print-memoryssa -verify-memoryssa -analyze < %s 2>&1 | FileCheck %s
2 ; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>,verify<memoryssa>' -disable-output < %s 2>&1 | FileCheck %s
3 ; This test checks a number of things:
4 ; First, the lifetime markers should not clobber any uses of Q or P.
5 ; Second, the loads of P are MemoryUse(LiveOnEntry) due to the placement of the markers vs the loads.
7 define i8 @test(i8* %P, i8* %Q) {
9 ; CHECK: 1 = MemoryDef(liveOnEntry)
10 ; CHECK-NEXT: call void @llvm.lifetime.start.p0i8(i64 32, i8* %P)
11 call void @llvm.lifetime.start.p0i8(i64 32, i8* %P)
13 ; CHECK-NEXT: %0 = load i8, i8* %P
15 ; CHECK: 2 = MemoryDef(1)
16 ; CHECK-NEXT: store i8 1, i8* %P
18 ; CHECK: 3 = MemoryDef(2)
19 ; CHECK-NEXT: call void @llvm.lifetime.end.p0i8(i64 32, i8* %P)
20 call void @llvm.lifetime.end.p0i8(i64 32, i8* %P)
21 ; CHECK: MemoryUse(liveOnEntry)
22 ; CHECK-NEXT: %1 = load i8, i8* %P
25 ; CHECK-NEXT: %2 = load i8, i8* %Q
29 declare void @llvm.lifetime.start.p0i8(i64 %S, i8* nocapture %P) readonly
30 declare void @llvm.lifetime.end.p0i8(i64 %S, i8* nocapture %P)