1 ; RUN: opt < %s -aa-pipeline=tbaa,basic-aa -passes=gvn -S | FileCheck %s
3 ; Test that basic alias queries work.
7 define i8 @test0_yes(ptr %a, ptr %b) nounwind {
8 %x = load i8, ptr %a, !tbaa !1
9 store i8 0, ptr %b, !tbaa !2
10 %y = load i8, ptr %a, !tbaa !1
16 ; CHECK: add i8 %x, %y
17 define i8 @test0_no(ptr %a, ptr %b) nounwind {
18 %x = load i8, ptr %a, !tbaa !3
19 store i8 0, ptr %b, !tbaa !4
20 %y = load i8, ptr %a, !tbaa !3
25 ; Test that basic invariant-memory queries work.
28 ; CHECK: add i8 %x, %x
29 define i8 @test1_yes(ptr %a, ptr %b) nounwind {
30 %x = load i8, ptr %a, !tbaa !5
32 %y = load i8, ptr %a, !tbaa !5
38 ; CHECK: add i8 %x, %y
39 define i8 @test1_no(ptr %a, ptr %b) nounwind {
40 %x = load i8, ptr %a, !tbaa !6
42 %y = load i8, ptr %a, !tbaa !6
51 ; Some other non-aliasing type.
56 ; Some type in a different type system.
57 !4 = !{!10, !10, i64 0}
60 !5 = !{!11, !11, i64 0, i1 1}
61 ; Not invariant memory.
62 !6 = !{!11, !11, i64 0, i1 0}
66 !10 = !{ !"bar", !12 }