• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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;
4; Checks that basicAA is doing some amount of disambiguation for us
5
6define i32 @foo(i1 %cond) {
7  %a = alloca i32, align 4
8  %b = alloca i32, align 4
9; CHECK: 1 = MemoryDef(liveOnEntry)
10; CHECK-NEXT: store i32 0
11  store i32 0, i32* %a, align 4
12; CHECK: 2 = MemoryDef(1)
13; CHECK-NEXT: store i32 1
14  store i32 1, i32* %b, align 4
15
16; CHECK: MemoryUse(1)
17; CHECK-NEXT: %1 = load i32
18  %1 = load i32, i32* %a, align 4
19; CHECK: MemoryUse(2)
20; CHECK-NEXT: %2 = load i32
21  %2 = load i32, i32* %b, align 4
22
23  %3 = add i32 %1, %2
24  ret i32 %3
25}
26