1 ; RUN: opt -scoped-noalias-aa -basic-aa -newgvn -S < %s | FileCheck %s
3 define i32 @test1(i32* %p, i32* %q) {
4 ; CHECK-LABEL: @test1(i32* %p, i32* %q)
5 ; CHECK: load i32, i32* %p
7 ; CHECK: %c = add i32 %a, %a
8 %a = load i32, i32* %p, !noalias !3
14 define i32 @test2(i32* %p, i32* %q) {
15 ; CHECK-LABEL: @test2(i32* %p, i32* %q)
16 ; CHECK: load i32, i32* %p, align 4, !alias.scope ![[SCOPE1:[0-9]+]]
17 ; CHECK: %c = add i32 %a, %a
18 %a = load i32, i32* %p, !alias.scope !3
19 %b = load i32, i32* %p, !alias.scope !3
24 define i32 @test3(i32* %p, i32* %q) {
25 ; CHECK-LABEL: @test3(i32* %p, i32* %q)
26 ; CHECK: load i32, i32* %p, align 4, !alias.scope ![[SCOPE2:[0-9]+]]
27 ; CHECK: %c = add i32 %a, %a
28 %a = load i32, i32* %p, !alias.scope !4
29 %b = load i32, i32* %p, !alias.scope !5
34 ; CHECK: ![[SCOPE1]] = !{!{{[0-9]+}}}
35 ; CHECK: ![[SCOPE2]] = !{!{{[0-9]+}}, !{{[0-9]+}}}
36 declare i32 @foo(i32*) readonly
38 !0 = distinct !{!0, !2, !"callee0: %a"}
39 !1 = distinct !{!1, !2, !"callee0: %b"}
40 !2 = distinct !{!2, !"callee0"}