diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2015-01-18 16:17:27 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2015-01-18 16:17:27 +0000 |
commit | 67c32a98315f785a9ec9d531c1f571a0196c7463 (patch) | |
tree | 4abb9cbeecc7901726dd0b4a37369596c852e9ef /test/Analysis | |
parent | 9f61947910e6ab40de38e6b4034751ef1513200f (diff) |
Diffstat (limited to 'test/Analysis')
63 files changed, 1417 insertions, 288 deletions
diff --git a/test/Analysis/BasicAA/2008-04-15-Byval.ll b/test/Analysis/BasicAA/2008-04-15-Byval.ll index 428189a8a874..2ea0314d5b60 100644 --- a/test/Analysis/BasicAA/2008-04-15-Byval.ll +++ b/test/Analysis/BasicAA/2008-04-15-Byval.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -std-compile-opts -S | FileCheck %s +; RUN: opt < %s -O3 -S | FileCheck %s ; ModuleID = 'small2.c' target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" target triple = "i386-apple-darwin8" diff --git a/test/Analysis/BasicAA/assume.ll b/test/Analysis/BasicAA/assume.ll new file mode 100644 index 000000000000..e163b5a4161c --- /dev/null +++ b/test/Analysis/BasicAA/assume.ll @@ -0,0 +1,23 @@ +; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s +target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:32:64-v128:32:128-a0:0:32-n32" + +declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) #0 +declare void @llvm.assume(i1) #0 + +define void @test1(i8* %P, i8* %Q) nounwind ssp { + tail call void @llvm.assume(i1 true) + tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) + ret void + +; CHECK-LABEL: Function: test1: + +; CHECK: MayAlias: i8* %P, i8* %Q +; CHECK: NoModRef: Ptr: i8* %P <-> tail call void @llvm.assume(i1 true) +; CHECK: NoModRef: Ptr: i8* %Q <-> tail call void @llvm.assume(i1 true) +; CHECK: Both ModRef: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: Both ModRef: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: NoModRef: tail call void @llvm.assume(i1 true) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: NoModRef: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) <-> tail call void @llvm.assume(i1 true) +} + +attributes #0 = { nounwind } diff --git a/test/Analysis/BasicAA/full-store-partial-alias.ll b/test/Analysis/BasicAA/full-store-partial-alias.ll index 4de2daf6b2dc..9699d92ea83f 100644 --- a/test/Analysis/BasicAA/full-store-partial-alias.ll +++ b/test/Analysis/BasicAA/full-store-partial-alias.ll @@ -29,9 +29,9 @@ entry: ret i32 %tmp5.lobit } -!0 = metadata !{metadata !4, metadata !4, i64 0} -!1 = metadata !{metadata !"omnipotent char", metadata !2} -!2 = metadata !{metadata !"Simple C/C++ TBAA", null} -!3 = metadata !{metadata !5, metadata !5, i64 0} -!4 = metadata !{metadata !"double", metadata !1} -!5 = metadata !{metadata !"int", metadata !1} +!0 = !{!4, !4, i64 0} +!1 = !{!"omnipotent char", !2} +!2 = !{!"Simple C/C++ TBAA", null} +!3 = !{!5, !5, i64 0} +!4 = !{!"double", !1} +!5 = !{!"int", !1} diff --git a/test/Analysis/BasicAA/gcsetest.ll b/test/Analysis/BasicAA/gcsetest.ll index db557b7a248b..64792eb00a2f 100644 --- a/test/Analysis/BasicAA/gcsetest.ll +++ b/test/Analysis/BasicAA/gcsetest.ll @@ -1,5 +1,5 @@ -; Test that GCSE uses basicaa to do alias analysis, which is capable of -; disambiguating some obvious cases. All loads should be removable in +; Test that GCSE uses basicaa to do alias analysis, which is capable of +; disambiguating some obvious cases. All loads should be removable in ; this testcase. ; RUN: opt < %s -basicaa -gvn -instcombine -dce -S | FileCheck %s diff --git a/test/Analysis/BasicAA/invariant_load.ll b/test/Analysis/BasicAA/invariant_load.ll index 09b54013a06b..bc629cdfe9ea 100644 --- a/test/Analysis/BasicAA/invariant_load.ll +++ b/test/Analysis/BasicAA/invariant_load.ll @@ -23,4 +23,4 @@ entry: ; CHECK: %add = add nsw i32 %0, 1 } -!3 = metadata !{} +!3 = !{} diff --git a/test/Analysis/BasicAA/modref.ll b/test/Analysis/BasicAA/modref.ll index 8421faf9c2c4..0d8bf71d42fe 100644 --- a/test/Analysis/BasicAA/modref.ll +++ b/test/Analysis/BasicAA/modref.ll @@ -8,20 +8,20 @@ declare void @external(i32*) define i32 @test0(i8* %P) { %A = alloca i32 call void @external(i32* %A) - + store i32 0, i32* %A - + call void @llvm.memset.p0i8.i32(i8* %P, i8 0, i32 42, i32 1, i1 false) - + %B = load i32* %A ret i32 %B - -; CHECK: @test0 + +; CHECK-LABEL: @test0 ; CHECK: ret i32 0 } define i8 @test1() { -; CHECK: @test1 +; CHECK-LABEL: @test1 %A = alloca i8 %B = alloca i8 @@ -35,7 +35,7 @@ define i8 @test1() { } define i8 @test2(i8* %P) { -; CHECK: @test2 +; CHECK-LABEL: @test2 %P2 = getelementptr i8* %P, i32 127 store i8 1, i8* %P2 ;; Not dead across memset call void @llvm.memset.p0i8.i8(i8* %P, i8 2, i8 127, i32 0, i1 false) @@ -45,12 +45,12 @@ define i8 @test2(i8* %P) { } define i8 @test2a(i8* %P) { -; CHECK: @test2 +; CHECK-LABEL: @test2 %P2 = getelementptr i8* %P, i32 126 - + ;; FIXME: DSE isn't zapping this dead store. store i8 1, i8* %P2 ;; Dead, clobbered by memset. - + call void @llvm.memset.p0i8.i8(i8* %P, i8 2, i8 127, i32 0, i1 false) %A = load i8* %P2 ret i8 %A @@ -59,11 +59,11 @@ define i8 @test2a(i8* %P) { } define void @test3(i8* %P, i8 %X) { -; CHECK: @test3 +; CHECK-LABEL: @test3 ; CHECK-NOT: store ; CHECK-NOT: %Y %Y = add i8 %X, 1 ;; Dead, because the only use (the store) is dead. - + %P2 = getelementptr i8* %P, i32 2 store i8 %Y, i8* %P2 ;; Not read by lifetime.end, should be removed. ; CHECK: store i8 2, i8* %P2 @@ -75,9 +75,9 @@ define void @test3(i8* %P, i8 %X) { } define void @test3a(i8* %P, i8 %X) { -; CHECK: @test3a +; CHECK-LABEL: @test3a %Y = add i8 %X, 1 ;; Dead, because the only use (the store) is dead. - + %P2 = getelementptr i8* %P, i32 2 store i8 %Y, i8* %P2 ; CHECK-NEXT: call void @llvm.lifetime.end @@ -95,7 +95,7 @@ define i32 @test4(i8* %P) { %tmp2 = load i32* @G1 %sub = sub i32 %tmp2, %tmp ret i32 %sub -; CHECK: @test4 +; CHECK-LABEL: @test4 ; CHECK-NOT: load ; CHECK: memset.p0i8.i32 ; CHECK-NOT: load @@ -123,7 +123,7 @@ define i8 @test6(i8* %p, i8* noalias %a) { %y = load i8* %a %z = add i8 %x, %y ret i8 %z -; CHECK: @test6 +; CHECK-LABEL: @test6 ; CHECK: load i8* %a ; CHECK-NOT: load ; CHECK: ret @@ -139,7 +139,7 @@ entry: call void @test7decl(i32* %add.ptr) %tmp = load i32* %x, align 4 ret i32 %tmp -; CHECK: @test7( +; CHECK-LABEL: @test7( ; CHECK: store i32 0 ; CHECK: call void @test7decl ; CHECK: load i32* diff --git a/test/Analysis/BasicAA/phi-aa.ll b/test/Analysis/BasicAA/phi-aa.ll index 74279e1c4c93..c1100f1d36fc 100644 --- a/test/Analysis/BasicAA/phi-aa.ll +++ b/test/Analysis/BasicAA/phi-aa.ll @@ -39,6 +39,7 @@ return: ; CHECK-LABEL: pr18068 ; CHECK: MayAlias: i32* %0, i32* %arrayidx5 +; CHECK: NoAlias: i32* %arrayidx13, i32* %arrayidx5 define i32 @pr18068(i32* %jj7, i32* %j) { entry: diff --git a/test/Analysis/BasicAA/zext.ll b/test/Analysis/BasicAA/zext.ll new file mode 100644 index 000000000000..b59d16cc5f51 --- /dev/null +++ b/test/Analysis/BasicAA/zext.ll @@ -0,0 +1,209 @@ +; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +; CHECK-LABEL: test_with_zext +; CHECK: NoAlias: i8* %a, i8* %b + +define void @test_with_zext() { + %1 = tail call i8* @malloc(i64 120) + %a = getelementptr inbounds i8* %1, i64 8 + %2 = getelementptr inbounds i8* %1, i64 16 + %3 = zext i32 3 to i64 + %b = getelementptr inbounds i8* %2, i64 %3 + ret void +} + +; CHECK-LABEL: test_with_lshr +; CHECK: NoAlias: i8* %a, i8* %b + +define void @test_with_lshr(i64 %i) { + %1 = tail call i8* @malloc(i64 120) + %a = getelementptr inbounds i8* %1, i64 8 + %2 = getelementptr inbounds i8* %1, i64 16 + %3 = lshr i64 %i, 2 + %b = getelementptr inbounds i8* %2, i64 %3 + ret void +} + +; CHECK-LABEL: test_with_a_loop +; CHECK: NoAlias: i8* %a, i8* %b + +define void @test_with_a_loop(i8* %mem) { + br label %for.loop + +for.loop: + %i = phi i32 [ 0, %0 ], [ %i.plus1, %for.loop ] + %a = getelementptr inbounds i8* %mem, i64 8 + %a.plus1 = getelementptr inbounds i8* %mem, i64 16 + %i.64 = zext i32 %i to i64 + %b = getelementptr inbounds i8* %a.plus1, i64 %i.64 + %i.plus1 = add nuw nsw i32 %i, 1 + %cmp = icmp eq i32 %i.plus1, 10 + br i1 %cmp, label %for.loop.exit, label %for.loop + +for.loop.exit: + ret void +} + +; CHECK-LABEL: test_with_varying_base_pointer_in_loop +; CHECK: NoAlias: i8* %a, i8* %b + +define void @test_with_varying_base_pointer_in_loop(i8* %mem.orig) { + br label %for.loop + +for.loop: + %mem = phi i8* [ %mem.orig, %0 ], [ %mem.plus1, %for.loop ] + %i = phi i32 [ 0, %0 ], [ %i.plus1, %for.loop ] + %a = getelementptr inbounds i8* %mem, i64 8 + %a.plus1 = getelementptr inbounds i8* %mem, i64 16 + %i.64 = zext i32 %i to i64 + %b = getelementptr inbounds i8* %a.plus1, i64 %i.64 + %i.plus1 = add nuw nsw i32 %i, 1 + %mem.plus1 = getelementptr inbounds i8* %mem, i64 8 + %cmp = icmp eq i32 %i.plus1, 10 + br i1 %cmp, label %for.loop.exit, label %for.loop + +for.loop.exit: + ret void +} + +; CHECK-LABEL: test_sign_extension +; CHECK: PartialAlias: i64* %b.i64, i8* %a + +define void @test_sign_extension(i32 %p) { + %1 = tail call i8* @malloc(i64 120) + %p.64 = zext i32 %p to i64 + %a = getelementptr inbounds i8* %1, i64 %p.64 + %p.minus1 = add i32 %p, -1 + %p.minus1.64 = zext i32 %p.minus1 to i64 + %b.i8 = getelementptr inbounds i8* %1, i64 %p.minus1.64 + %b.i64 = bitcast i8* %b.i8 to i64* + ret void +} + +; CHECK-LABEL: test_fe_tools +; CHECK: PartialAlias: i32* %a, i32* %b + +define void @test_fe_tools([8 x i32]* %values) { + br label %reorder + +for.loop: + %i = phi i32 [ 0, %reorder ], [ %i.next, %for.loop ] + %idxprom = zext i32 %i to i64 + %b = getelementptr inbounds [8 x i32]* %values, i64 0, i64 %idxprom + %i.next = add nuw nsw i32 %i, 1 + %1 = icmp eq i32 %i.next, 10 + br i1 %1, label %for.loop.exit, label %for.loop + +reorder: + %a = getelementptr inbounds [8 x i32]* %values, i64 0, i64 1 + br label %for.loop + +for.loop.exit: + ret void +} + +@b = global i32 0, align 4 +@d = global i32 0, align 4 + +; CHECK-LABEL: test_spec2006 +; CHECK: PartialAlias: i32** %x, i32** %y + +define void @test_spec2006() { + %h = alloca [1 x [2 x i32*]], align 16 + %d.val = load i32* @d, align 4 + %d.promoted = sext i32 %d.val to i64 + %1 = icmp slt i32 %d.val, 2 + br i1 %1, label %.lr.ph, label %3 + +.lr.ph: ; preds = %0 + br label %2 + +; <label>:2 ; preds = %.lr.ph, %2 + %i = phi i32 [ %d.val, %.lr.ph ], [ %i.plus1, %2 ] + %i.promoted = sext i32 %i to i64 + %x = getelementptr inbounds [1 x [2 x i32*]]* %h, i64 0, i64 %d.promoted, i64 %i.promoted + %i.plus1 = add nsw i32 %i, 1 + %cmp = icmp slt i32 %i.plus1, 2 + br i1 %cmp, label %2, label %3 + +; <label>:3 ; preds = %._crit_edge, %0 + %y = getelementptr inbounds [1 x [2 x i32*]]* %h, i64 0, i64 0, i64 1 + ret void +} + +; CHECK-LABEL: test_modulo_analysis_easy_case +; CHECK: NoAlias: i32** %x, i32** %y + +define void @test_modulo_analysis_easy_case(i64 %i) { + %h = alloca [1 x [2 x i32*]], align 16 + %x = getelementptr inbounds [1 x [2 x i32*]]* %h, i64 0, i64 %i, i64 0 + %y = getelementptr inbounds [1 x [2 x i32*]]* %h, i64 0, i64 0, i64 1 + ret void +} + +; CHECK-LABEL: test_modulo_analysis_in_loop +; CHECK: NoAlias: i32** %x, i32** %y + +define void @test_modulo_analysis_in_loop() { + %h = alloca [1 x [2 x i32*]], align 16 + br label %for.loop + +for.loop: + %i = phi i32 [ 0, %0 ], [ %i.plus1, %for.loop ] + %i.promoted = sext i32 %i to i64 + %x = getelementptr inbounds [1 x [2 x i32*]]* %h, i64 0, i64 %i.promoted, i64 0 + %y = getelementptr inbounds [1 x [2 x i32*]]* %h, i64 0, i64 0, i64 1 + %i.plus1 = add nsw i32 %i, 1 + %cmp = icmp slt i32 %i.plus1, 2 + br i1 %cmp, label %for.loop, label %for.loop.exit + +for.loop.exit: + ret void +} + +; CHECK-LABEL: test_modulo_analysis_with_global +; CHECK: PartialAlias: i32** %x, i32** %y + +define void @test_modulo_analysis_with_global() { + %h = alloca [1 x [2 x i32*]], align 16 + %b = load i32* @b, align 4 + %b.promoted = sext i32 %b to i64 + br label %for.loop + +for.loop: + %i = phi i32 [ 0, %0 ], [ %i.plus1, %for.loop ] + %i.promoted = sext i32 %i to i64 + %x = getelementptr inbounds [1 x [2 x i32*]]* %h, i64 0, i64 %i.promoted, i64 %b.promoted + %y = getelementptr inbounds [1 x [2 x i32*]]* %h, i64 0, i64 0, i64 1 + %i.plus1 = add nsw i32 %i, 1 + %cmp = icmp slt i32 %i.plus1, 2 + br i1 %cmp, label %for.loop, label %for.loop.exit + +for.loop.exit: + ret void +} + +; CHECK-LABEL: test_const_eval +; CHECK: NoAlias: i8* %a, i8* %b +define void @test_const_eval(i8* %ptr, i64 %offset) { + %a = getelementptr inbounds i8* %ptr, i64 %offset + %a.dup = getelementptr inbounds i8* %ptr, i64 %offset + %three = zext i32 3 to i64 + %b = getelementptr inbounds i8* %a.dup, i64 %three + ret void +} + +; CHECK-LABEL: test_const_eval_scaled +; CHECK: MustAlias: i8* %a, i8* %b +define void @test_const_eval_scaled(i8* %ptr) { + %three = zext i32 3 to i64 + %six = mul i64 %three, 2 + %a = getelementptr inbounds i8* %ptr, i64 %six + %b = getelementptr inbounds i8* %ptr, i64 6 + ret void +} + +; Function Attrs: nounwind +declare noalias i8* @malloc(i64) diff --git a/test/Analysis/BlockFrequencyInfo/bad_input.ll b/test/Analysis/BlockFrequencyInfo/bad_input.ll index bcdc1e6f0bc0..da62dca67a8b 100644 --- a/test/Analysis/BlockFrequencyInfo/bad_input.ll +++ b/test/Analysis/BlockFrequencyInfo/bad_input.ll @@ -23,7 +23,7 @@ for.end: ret void } -!0 = metadata !{metadata !"branch_weights", i32 0, i32 3} +!0 = !{!"branch_weights", i32 0, i32 3} ; CHECK-LABEL: Printing analysis {{.*}} for function 'infinite_loop' ; CHECK-NEXT: block-frequency-info: infinite_loop @@ -47,4 +47,4 @@ for.end: ret void } -!1 = metadata !{metadata !"branch_weights", i32 1, i32 1} +!1 = !{!"branch_weights", i32 1, i32 1} diff --git a/test/Analysis/BlockFrequencyInfo/basic.ll b/test/Analysis/BlockFrequencyInfo/basic.ll index 006e6ab4d74e..1c24176d6153 100644 --- a/test/Analysis/BlockFrequencyInfo/basic.ll +++ b/test/Analysis/BlockFrequencyInfo/basic.ll @@ -47,7 +47,7 @@ exit: ret i32 %result } -!0 = metadata !{metadata !"branch_weights", i32 64, i32 4} +!0 = !{!"branch_weights", i32 64, i32 4} define i32 @test3(i32 %i, i32 %a, i32 %b, i32 %c, i32 %d, i32 %e) { ; CHECK-LABEL: Printing analysis {{.*}} for function 'test3': @@ -90,7 +90,7 @@ exit: ret i32 %result } -!1 = metadata !{metadata !"branch_weights", i32 4, i32 4, i32 64, i32 4, i32 4} +!1 = !{!"branch_weights", i32 4, i32 4, i32 64, i32 4, i32 4} define void @nested_loops(i32 %a) { ; CHECK-LABEL: Printing analysis {{.*}} for function 'nested_loops': @@ -138,4 +138,4 @@ for.end13: declare void @g(i32) -!2 = metadata !{metadata !"branch_weights", i32 1, i32 4000} +!2 = !{!"branch_weights", i32 1, i32 4000} diff --git a/test/Analysis/BlockFrequencyInfo/double_backedge.ll b/test/Analysis/BlockFrequencyInfo/double_backedge.ll index df8217cfa1b1..597bf8329b26 100644 --- a/test/Analysis/BlockFrequencyInfo/double_backedge.ll +++ b/test/Analysis/BlockFrequencyInfo/double_backedge.ll @@ -23,5 +23,5 @@ exit: ; CHECK-NEXT: exit: float = 1.0, int = [[ENTRY]] ret void } -!0 = metadata !{metadata !"branch_weights", i32 1, i32 9} -!1 = metadata !{metadata !"branch_weights", i32 4, i32 5} +!0 = !{!"branch_weights", i32 1, i32 9} +!1 = !{!"branch_weights", i32 4, i32 5} diff --git a/test/Analysis/BlockFrequencyInfo/double_exit.ll b/test/Analysis/BlockFrequencyInfo/double_exit.ll index 75f664d07ac4..3063ba701731 100644 --- a/test/Analysis/BlockFrequencyInfo/double_exit.ll +++ b/test/Analysis/BlockFrequencyInfo/double_exit.ll @@ -66,9 +66,9 @@ exit: ret i32 %Return.2 } -!0 = metadata !{metadata !"branch_weights", i32 1, i32 3} -!1 = metadata !{metadata !"branch_weights", i32 4, i32 1} -!2 = metadata !{metadata !"branch_weights", i32 2, i32 1} +!0 = !{!"branch_weights", i32 1, i32 3} +!1 = !{!"branch_weights", i32 4, i32 1} +!2 = !{!"branch_weights", i32 2, i32 1} declare i32 @c2(i32, i32) declare i32 @logic2(i32, i32, i32) @@ -159,7 +159,7 @@ exit: ret i32 %Return.0 } -!3 = metadata !{metadata !"branch_weights", i32 1, i32 1} +!3 = !{!"branch_weights", i32 1, i32 1} declare i32 @c3(i32, i32, i32) declare i32 @logic3(i32, i32, i32, i32) diff --git a/test/Analysis/BlockFrequencyInfo/extremely-likely-loop-successor.ll b/test/Analysis/BlockFrequencyInfo/extremely-likely-loop-successor.ll index f1ddd13ef0d6..e55deaff428d 100644 --- a/test/Analysis/BlockFrequencyInfo/extremely-likely-loop-successor.ll +++ b/test/Analysis/BlockFrequencyInfo/extremely-likely-loop-successor.ll @@ -37,4 +37,4 @@ exit: declare i1 @foo() -!0 = metadata !{metadata !"branch_weights", i32 4294967295, i32 1} +!0 = !{!"branch_weights", i32 4294967295, i32 1} diff --git a/test/Analysis/BlockFrequencyInfo/irreducible.ll b/test/Analysis/BlockFrequencyInfo/irreducible.ll index af4ad15d9c1d..b275aae62792 100644 --- a/test/Analysis/BlockFrequencyInfo/irreducible.ll +++ b/test/Analysis/BlockFrequencyInfo/irreducible.ll @@ -31,8 +31,8 @@ return: ret void } -!0 = metadata !{metadata !"branch_weights", i32 1, i32 7} -!1 = metadata !{metadata !"branch_weights", i32 3, i32 4} +!0 = !{!"branch_weights", i32 1, i32 7} +!1 = !{!"branch_weights", i32 3, i32 4} ; Irreducible control flow ; ======================== @@ -112,7 +112,7 @@ exit: ret void } -!2 = metadata !{metadata !"branch_weights", i32 3, i32 1} +!2 = !{!"branch_weights", i32 3, i32 1} ; Testcase #2 ; =========== @@ -156,7 +156,7 @@ exit: ret void } -!3 = metadata !{metadata !"branch_weights", i32 2, i32 2, i32 2} +!3 = !{!"branch_weights", i32 2, i32 2, i32 2} ; A true loop with irreducible control flow inside. define void @loop_around_irreducible(i1 %x) { @@ -186,8 +186,8 @@ exit: ; CHECK-NEXT: exit: float = 1.0, int = [[ENTRY]] ret void } -!4 = metadata !{metadata !"branch_weights", i32 1, i32 1} -!5 = metadata !{metadata !"branch_weights", i32 3, i32 1} +!4 = !{!"branch_weights", i32 1, i32 1} +!5 = !{!"branch_weights", i32 3, i32 1} ; Two unrelated irreducible SCCs. define void @two_sccs(i1 %x) { @@ -225,9 +225,9 @@ exit: ; CHECK-NEXT: exit: float = 1.0, int = [[ENTRY]] ret void } -!6 = metadata !{metadata !"branch_weights", i32 3, i32 1} -!7 = metadata !{metadata !"branch_weights", i32 1, i32 1} -!8 = metadata !{metadata !"branch_weights", i32 4, i32 1} +!6 = !{!"branch_weights", i32 3, i32 1} +!7 = !{!"branch_weights", i32 1, i32 1} +!8 = !{!"branch_weights", i32 4, i32 1} ; A true loop inside irreducible control flow. define void @loop_inside_irreducible(i1 %x) { @@ -257,9 +257,9 @@ exit: ; CHECK-NEXT: exit: float = 1.0, int = [[ENTRY]] ret void } -!9 = metadata !{metadata !"branch_weights", i32 1, i32 1} -!10 = metadata !{metadata !"branch_weights", i32 3, i32 1} -!11 = metadata !{metadata !"branch_weights", i32 2, i32 1} +!9 = !{!"branch_weights", i32 1, i32 1} +!10 = !{!"branch_weights", i32 3, i32 1} +!11 = !{!"branch_weights", i32 2, i32 1} ; Irreducible control flow in a branch that's in a true loop. define void @loop_around_branch_with_irreducible(i1 %x) { @@ -301,8 +301,8 @@ exit: ; CHECK-NEXT: exit: float = 1.0, int = [[ENTRY]] ret void } -!12 = metadata !{metadata !"branch_weights", i32 3, i32 1} -!13 = metadata !{metadata !"branch_weights", i32 1, i32 1} +!12 = !{!"branch_weights", i32 3, i32 1} +!13 = !{!"branch_weights", i32 1, i32 1} ; Irreducible control flow between two true loops. define void @loop_around_branch_with_irreducible_around_loop(i1 %x) { @@ -348,10 +348,10 @@ exit: ; CHECK-NEXT: exit: float = 1.0, int = [[ENTRY]] ret void } -!14 = metadata !{metadata !"branch_weights", i32 2, i32 1} -!15 = metadata !{metadata !"branch_weights", i32 1, i32 1} -!16 = metadata !{metadata !"branch_weights", i32 3, i32 1} -!17 = metadata !{metadata !"branch_weights", i32 4, i32 1} +!14 = !{!"branch_weights", i32 2, i32 1} +!15 = !{!"branch_weights", i32 1, i32 1} +!16 = !{!"branch_weights", i32 3, i32 1} +!17 = !{!"branch_weights", i32 4, i32 1} ; An irreducible SCC with a non-header. define void @nonheader(i1 %x) { @@ -377,9 +377,9 @@ exit: ; CHECK-NEXT: exit: float = 1.0, int = [[ENTRY]] ret void } -!18 = metadata !{metadata !"branch_weights", i32 1, i32 1} -!19 = metadata !{metadata !"branch_weights", i32 1, i32 3} -!20 = metadata !{metadata !"branch_weights", i32 3, i32 1} +!18 = !{!"branch_weights", i32 1, i32 1} +!19 = !{!"branch_weights", i32 1, i32 3} +!20 = !{!"branch_weights", i32 3, i32 1} ; An irreducible SCC with an irreducible sub-SCC. In the current version of ; -block-freq, this means an extra header. @@ -416,6 +416,6 @@ exit: ; CHECK-NEXT: exit: float = 1.0, int = [[ENTRY]] ret void } -!21 = metadata !{metadata !"branch_weights", i32 2, i32 1} -!22 = metadata !{metadata !"branch_weights", i32 1, i32 1} -!23 = metadata !{metadata !"branch_weights", i32 8, i32 1, i32 3, i32 12} +!21 = !{!"branch_weights", i32 2, i32 1} +!22 = !{!"branch_weights", i32 1, i32 1} +!23 = !{!"branch_weights", i32 8, i32 1, i32 3, i32 12} diff --git a/test/Analysis/BlockFrequencyInfo/loop_with_branch.ll b/test/Analysis/BlockFrequencyInfo/loop_with_branch.ll index 9d27b6bf0f20..9a86564c548d 100644 --- a/test/Analysis/BlockFrequencyInfo/loop_with_branch.ll +++ b/test/Analysis/BlockFrequencyInfo/loop_with_branch.ll @@ -40,5 +40,5 @@ exit: declare i1 @foo0(i32) declare i2 @foo1(i32) -!0 = metadata !{metadata !"branch_weights", i32 1, i32 3} -!1 = metadata !{metadata !"branch_weights", i32 1, i32 2, i32 3} +!0 = !{!"branch_weights", i32 1, i32 3} +!1 = !{!"branch_weights", i32 1, i32 2, i32 3} diff --git a/test/Analysis/BlockFrequencyInfo/nested_loop_with_branches.ll b/test/Analysis/BlockFrequencyInfo/nested_loop_with_branches.ll index d93ffceb5fab..19d165805b04 100644 --- a/test/Analysis/BlockFrequencyInfo/nested_loop_with_branches.ll +++ b/test/Analysis/BlockFrequencyInfo/nested_loop_with_branches.ll @@ -55,5 +55,5 @@ declare i1 @foo4(i32) declare i1 @foo5(i32) declare i1 @foo6(i32) -!0 = metadata !{metadata !"branch_weights", i32 1, i32 3} -!1 = metadata !{metadata !"branch_weights", i32 3, i32 1} +!0 = !{!"branch_weights", i32 1, i32 3} +!1 = !{!"branch_weights", i32 3, i32 1} diff --git a/test/Analysis/BranchProbabilityInfo/basic.ll b/test/Analysis/BranchProbabilityInfo/basic.ll index 05cb31dca0ee..5915ed152b06 100644 --- a/test/Analysis/BranchProbabilityInfo/basic.ll +++ b/test/Analysis/BranchProbabilityInfo/basic.ll @@ -43,7 +43,7 @@ exit: ret i32 %result } -!0 = metadata !{metadata !"branch_weights", i32 64, i32 4} +!0 = !{!"branch_weights", i32 64, i32 4} define i32 @test3(i32 %i, i32 %a, i32 %b, i32 %c, i32 %d, i32 %e) { ; CHECK: Printing analysis {{.*}} for function 'test3' @@ -87,7 +87,7 @@ exit: ret i32 %result } -!1 = metadata !{metadata !"branch_weights", i32 4, i32 4, i32 64, i32 4, i32 4} +!1 = !{!"branch_weights", i32 4, i32 4, i32 64, i32 4, i32 4} define i32 @test4(i32 %x) nounwind uwtable readnone ssp { ; CHECK: Printing analysis {{.*}} for function 'test4' @@ -114,7 +114,7 @@ return: ret i32 %retval.0 } -!2 = metadata !{metadata !"branch_weights", i32 7, i32 6, i32 4, i32 4, i32 64} +!2 = !{!"branch_weights", i32 7, i32 6, i32 4, i32 4, i32 64} declare void @coldfunc() cold diff --git a/test/Analysis/CFLAliasAnalysis/arguments-globals.ll b/test/Analysis/CFLAliasAnalysis/arguments-globals.ll new file mode 100644 index 000000000000..18bbe8b6b41f --- /dev/null +++ b/test/Analysis/CFLAliasAnalysis/arguments-globals.ll @@ -0,0 +1,20 @@ +; This testcase ensures that CFL AA gives conservative answers on variables +; that involve arguments. +; (Everything should alias everything, because args can alias globals, so the +; aliasing sets should of args+alloca+global should be combined) + +; RUN: opt < %s -cfl-aa -aa-eval -print-may-aliases -disable-output 2>&1 | FileCheck %s + +; CHECK: Function: test + +@g = external global i32 + +define void @test(i1 %c, i32* %arg1, i32* %arg2) { + ; CHECK: 15 Total Alias Queries Performed + ; CHECK: 0 no alias responses + %A = alloca i32, align 4 + %B = select i1 %c, i32* %arg1, i32* %arg2 + %C = select i1 %c, i32* @g, i32* %A + + ret void +} diff --git a/test/Analysis/CFLAliasAnalysis/arguments.ll b/test/Analysis/CFLAliasAnalysis/arguments.ll new file mode 100644 index 000000000000..f3e6679c35e2 --- /dev/null +++ b/test/Analysis/CFLAliasAnalysis/arguments.ll @@ -0,0 +1,15 @@ +; This testcase ensures that CFL AA gives conservative answers on variables +; that involve arguments. + +; RUN: opt < %s -cfl-aa -aa-eval -print-may-aliases -disable-output 2>&1 | FileCheck %s + +; CHECK: Function: test + +define void @test(i1 %c, i32* %arg1, i32* %arg2) { + ; CHECK: 6 Total Alias Queries Performed + ; CHECK: 3 no alias responses + %a = alloca i32, align 4 + %b = select i1 %c, i32* %arg1, i32* %arg2 + + ret void +} diff --git a/test/Analysis/CFLAliasAnalysis/basic-interproc-ret.ll b/test/Analysis/CFLAliasAnalysis/basic-interproc-ret.ll new file mode 100644 index 000000000000..d56a4552b51e --- /dev/null +++ b/test/Analysis/CFLAliasAnalysis/basic-interproc-ret.ll @@ -0,0 +1,26 @@ +; This testcase ensures that CFL AA gives conservative answers on variables +; that involve arguments. + +; RUN: opt < %s -cfl-aa -aa-eval -print-may-aliases -disable-output 2>&1 | FileCheck %s + +; CHECK: Function: test +; CHECK: 4 Total Alias Queries Performed +; CHECK: 3 no alias responses +; ^ The 1 MayAlias is due to %arg1. Sadly, we don't currently have machinery +; in place to check whether %arg1 aliases %a, because BasicAA takes care of +; that for us. + +define i32* @test2(i32* %arg1) { + store i32 0, i32* %arg1 + + %a = alloca i32, align 4 + ret i32* %a +} + +define void @test() { + %a = alloca i32, align 4 + %b = alloca i32, align 4 + %c = call i32* @test2(i32* %a) + + ret void +} diff --git a/test/Analysis/CFLAliasAnalysis/basic-interproc.ll b/test/Analysis/CFLAliasAnalysis/basic-interproc.ll new file mode 100644 index 000000000000..c0a5404eab6e --- /dev/null +++ b/test/Analysis/CFLAliasAnalysis/basic-interproc.ll @@ -0,0 +1,24 @@ +; This testcase ensures that CFL AA gives conservative answers on variables +; that involve arguments. + +; RUN: opt < %s -cfl-aa -aa-eval -print-may-aliases -disable-output 2>&1 | FileCheck %s + +; CHECK: Function: test +; CHECK: 2 Total Alias Queries Performed +; CHECK: 1 no alias responses +; ^^ In @test2, %arg1 and %arg2 may alias + +define void @test2(i32* %arg1, i32* %arg2) { + store i32 0, i32* %arg1 + store i32 0, i32* %arg2 + + ret void +} + +define void @test() { + %a = alloca i32, align 4 + %b = alloca i32, align 4 + call void @test2(i32* %a, i32* %b) + + ret void +} diff --git a/test/Analysis/CFLAliasAnalysis/const-expr-gep.ll b/test/Analysis/CFLAliasAnalysis/const-expr-gep.ll new file mode 100644 index 000000000000..9ae200bc5701 --- /dev/null +++ b/test/Analysis/CFLAliasAnalysis/const-expr-gep.ll @@ -0,0 +1,21 @@ +; This testcase consists of alias relations which should be completely +; resolvable by cfl-aa, but require analysis of getelementptr constant exprs. +; Derived from BasicAA/2003-12-11-ConstExprGEP.ll + +; RUN: opt < %s -cfl-aa -aa-eval -print-may-aliases -disable-output 2>&1 | FileCheck %s + +%T = type { i32, [10 x i8] } + +@G = external global %T + +; CHECK: Function: test +; CHECK-NOT: May: + +define void @test() { + %D = getelementptr %T* @G, i64 0, i32 0 + %E = getelementptr %T* @G, i64 0, i32 1, i64 5 + %F = getelementptr i32* getelementptr (%T* @G, i64 0, i32 0), i64 0 + %X = getelementptr [10 x i8]* getelementptr (%T* @G, i64 0, i32 1), i64 0, i64 5 + + ret void +} diff --git a/test/Analysis/CFLAliasAnalysis/constant-over-index.ll b/test/Analysis/CFLAliasAnalysis/constant-over-index.ll new file mode 100644 index 000000000000..fb44b95d134f --- /dev/null +++ b/test/Analysis/CFLAliasAnalysis/constant-over-index.ll @@ -0,0 +1,30 @@ +; RUN: opt < %s -cfl-aa -aa-eval -print-all-alias-modref-info 2>&1 | FileCheck %s + +; CFL AA currently returns PartialAlias, BasicAA returns MayAlias, both seem +; acceptable (although we might decide that we don't want PartialAlias, and if +; so, we should update this test case accordingly). +; CHECK: {{PartialAlias|MayAlias}}: double* %p.0.i.0, double* %p3 + +; %p3 is equal to %p.0.i.0 on the second iteration of the loop, +; so MayAlias is needed. + +define void @foo([3 x [3 x double]]* noalias %p) { +entry: + %p3 = getelementptr [3 x [3 x double]]* %p, i64 0, i64 0, i64 3 + br label %loop + +loop: + %i = phi i64 [ 0, %entry ], [ %i.next, %loop ] + + %p.0.i.0 = getelementptr [3 x [3 x double]]* %p, i64 0, i64 %i, i64 0 + + store volatile double 0.0, double* %p3 + store volatile double 0.1, double* %p.0.i.0 + + %i.next = add i64 %i, 1 + %cmp = icmp slt i64 %i.next, 3 + br i1 %cmp, label %loop, label %exit + +exit: + ret void +} diff --git a/test/Analysis/CFLAliasAnalysis/empty.ll b/test/Analysis/CFLAliasAnalysis/empty.ll new file mode 100644 index 000000000000..907fa481d86d --- /dev/null +++ b/test/Analysis/CFLAliasAnalysis/empty.ll @@ -0,0 +1,12 @@ +; RUN: opt < %s -cfl-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s + +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" + +; CHECK: Function: foo: +; CHECK-NEXT: NoAlias: {}* %p, {}* %q + +define void @foo({}* %p, {}* %q) { + store {} {}, {}* %p + store {} {}, {}* %q + ret void +} diff --git a/test/Analysis/CFLAliasAnalysis/full-store-partial-alias.ll b/test/Analysis/CFLAliasAnalysis/full-store-partial-alias.ll new file mode 100644 index 000000000000..664ea9eb1180 --- /dev/null +++ b/test/Analysis/CFLAliasAnalysis/full-store-partial-alias.ll @@ -0,0 +1,37 @@ +; RUN: opt -S -tbaa -cfl-aa -gvn < %s | FileCheck -check-prefix=CFLAA %s +; RUN: opt -S -tbaa -gvn < %s | FileCheck %s +; Adapted from the BasicAA full-store-partial-alias.ll test. + +; CFL AA should notice that the store stores to the entire %u object, +; so the %tmp5 load is PartialAlias with the store and suppress TBAA. +; Without CFL AA, TBAA should say that %tmp5 is NoAlias with the store. + +target datalayout = "e-p:64:64:64" + +%union.anon = type { double } + +@u = global %union.anon { double -2.500000e-01 }, align 8 +@endianness_test = global i64 1, align 8 + +define i32 @signbit(double %x) nounwind { +; CFLAA: ret i32 %tmp5.lobit +; CHECK: ret i32 0 +entry: + %u = alloca %union.anon, align 8 + %tmp9 = getelementptr inbounds %union.anon* %u, i64 0, i32 0 + store double %x, double* %tmp9, align 8, !tbaa !0 + %tmp2 = load i32* bitcast (i64* @endianness_test to i32*), align 8, !tbaa !3 + %idxprom = sext i32 %tmp2 to i64 + %tmp4 = bitcast %union.anon* %u to [2 x i32]* + %arrayidx = getelementptr inbounds [2 x i32]* %tmp4, i64 0, i64 %idxprom + %tmp5 = load i32* %arrayidx, align 4, !tbaa !3 + %tmp5.lobit = lshr i32 %tmp5, 31 + ret i32 %tmp5.lobit +} + +!0 = !{!4, !4, i64 0} +!1 = !{!"omnipotent char", !2} +!2 = !{!"Simple C/C++ TBAA", null} +!3 = !{!5, !5, i64 0} +!4 = !{!"double", !1} +!5 = !{!"int", !1} diff --git a/test/Analysis/CFLAliasAnalysis/gep-signed-arithmetic.ll b/test/Analysis/CFLAliasAnalysis/gep-signed-arithmetic.ll new file mode 100644 index 000000000000..a0195d7f8d6a --- /dev/null +++ b/test/Analysis/CFLAliasAnalysis/gep-signed-arithmetic.ll @@ -0,0 +1,17 @@ +; RUN: opt < %s -cfl-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s +; Derived from BasicAA/2010-09-15-GEP-SignedArithmetic.ll + +target datalayout = "e-p:32:32:32" + +; CHECK: 1 partial alias response + +define i32 @test(i32* %tab, i32 %indvar) nounwind { + %tmp31 = mul i32 %indvar, -2 + %tmp32 = add i32 %tmp31, 30 + %t.5 = getelementptr i32* %tab, i32 %tmp32 + %loada = load i32* %tab + store i32 0, i32* %t.5 + %loadb = load i32* %tab + %rval = add i32 %loada, %loadb + ret i32 %rval +} diff --git a/test/Analysis/CFLAliasAnalysis/multilevel-combine.ll b/test/Analysis/CFLAliasAnalysis/multilevel-combine.ll new file mode 100644 index 000000000000..9bbc721a7b16 --- /dev/null +++ b/test/Analysis/CFLAliasAnalysis/multilevel-combine.ll @@ -0,0 +1,31 @@ +; This testcase ensures that CFL AA responds conservatively when we union +; groups of pointers together through ternary/conditional operations +; Derived from: +; void foo(bool c) { +; char a, b; +; char *m = c ? &a : &b; +; *m; +; } +; + +; RUN: opt < %s -cfl-aa -aa-eval -print-may-aliases -disable-output 2>&1 | FileCheck %s + +%T = type { i32, [10 x i8] } + +; CHECK: Function: test + +define void @test(i1 %C) { +; CHECK: 10 Total Alias Queries Performed +; CHECK: 4 no alias responses + %M = alloca %T*, align 8 ; NoAlias with %A, %B, %MS, %AP + %A = alloca %T, align 8 + %B = alloca %T, align 8 + + %MS = select i1 %C, %T* %B, %T* %A + + store %T* %MS, %T** %M + + %AP = load %T** %M ; PartialAlias with %A, %B + + ret void +} diff --git a/test/Analysis/CFLAliasAnalysis/multilevel.ll b/test/Analysis/CFLAliasAnalysis/multilevel.ll new file mode 100644 index 000000000000..9c9eb9a49779 --- /dev/null +++ b/test/Analysis/CFLAliasAnalysis/multilevel.ll @@ -0,0 +1,30 @@ +; This testcase ensures that CFL AA handles trivial cases with storing +; pointers in pointers appropriately. +; Derived from: +; char a, b; +; char *m = &a, *n = &b; +; *m; +; *n; + +; RUN: opt < %s -cfl-aa -aa-eval -print-may-aliases -disable-output 2>&1 | FileCheck %s + +%T = type { i32, [10 x i8] } + +; CHECK: Function: test + +define void @test() { +; CHECK: 15 Total Alias Queries Performed +; CHECK: 13 no alias responses + %M = alloca %T*, align 8 + %N = alloca %T*, align 8 + %A = alloca %T, align 8 + %B = alloca %T, align 8 + + store %T* %A, %T** %M + store %T* %B, %T** %N + + %AP = load %T** %M ; PartialAlias with %A + %BP = load %T** %N ; PartialAlias with %B + + ret void +} diff --git a/test/Analysis/CFLAliasAnalysis/must-and-partial.ll b/test/Analysis/CFLAliasAnalysis/must-and-partial.ll new file mode 100644 index 000000000000..df7de38ebd73 --- /dev/null +++ b/test/Analysis/CFLAliasAnalysis/must-and-partial.ll @@ -0,0 +1,39 @@ +; RUN: opt < %s -cfl-aa -aa-eval -print-all-alias-modref-info 2>&1 | FileCheck %s + +; When merging MustAlias and PartialAlias, merge to PartialAlias +; instead of MayAlias. + + +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" + +; CHECK: PartialAlias: i16* %bigbase0, i8* %phi +define i8 @test0(i8* %base, i1 %x) { +entry: + %baseplusone = getelementptr i8* %base, i64 1 + br i1 %x, label %red, label %green +red: + br label %green +green: + %phi = phi i8* [ %baseplusone, %red ], [ %base, %entry ] + store i8 0, i8* %phi + + %bigbase0 = bitcast i8* %base to i16* + store i16 -1, i16* %bigbase0 + + %loaded = load i8* %phi + ret i8 %loaded +} + +; CHECK: PartialAlias: i16* %bigbase1, i8* %sel +define i8 @test1(i8* %base, i1 %x) { +entry: + %baseplusone = getelementptr i8* %base, i64 1 + %sel = select i1 %x, i8* %baseplusone, i8* %base + store i8 0, i8* %sel + + %bigbase1 = bitcast i8* %base to i16* + store i16 -1, i16* %bigbase1 + + %loaded = load i8* %sel + ret i8 %loaded +} diff --git a/test/Analysis/CFLAliasAnalysis/phi-and-select.ll b/test/Analysis/CFLAliasAnalysis/phi-and-select.ll new file mode 100644 index 000000000000..a0e71a7e7dca --- /dev/null +++ b/test/Analysis/CFLAliasAnalysis/phi-and-select.ll @@ -0,0 +1,36 @@ +; RUN: opt < %s -cfl-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s +; Derived from (a subset of) BasicAA/phi-and-select.ll + +; CHECK: Function: qux +; CHECK: NoAlias: double* %a, double* %b +; CHECK: ===== Alias Analysis Evaluator Report ===== + +; Two PHIs with disjoint sets of inputs. +define void @qux(i1 %m, double* noalias %x, double* noalias %y, + i1 %n, double* noalias %v, double* noalias %w) { +entry: + br i1 %m, label %true, label %false + +true: + br label %exit + +false: + br label %exit + +exit: + %a = phi double* [ %x, %true ], [ %y, %false ] + br i1 %n, label %ntrue, label %nfalse + +ntrue: + br label %nexit + +nfalse: + br label %nexit + +nexit: + %b = phi double* [ %v, %ntrue ], [ %w, %nfalse ] + store volatile double 0.0, double* %a + store volatile double 1.0, double* %b + ret void +} + diff --git a/test/Analysis/CFLAliasAnalysis/simple.ll b/test/Analysis/CFLAliasAnalysis/simple.ll new file mode 100644 index 000000000000..7bc455ae7a2d --- /dev/null +++ b/test/Analysis/CFLAliasAnalysis/simple.ll @@ -0,0 +1,18 @@ +; This testcase consists of alias relations which should be completely +; resolvable by cfl-aa (derived from BasicAA/2003-11-04-SimpleCases.ll). + +; RUN: opt < %s -cfl-aa -aa-eval -print-may-aliases -disable-output 2>&1 | FileCheck %s + +%T = type { i32, [10 x i8] } + +; CHECK: Function: test +; CHECK-NOT: May: + +define void @test(%T* %P) { + %A = getelementptr %T* %P, i64 0 + %B = getelementptr %T* %P, i64 0, i32 0 + %C = getelementptr %T* %P, i64 0, i32 1 + %D = getelementptr %T* %P, i64 0, i32 1, i64 0 + %E = getelementptr %T* %P, i64 0, i32 1, i64 5 + ret void +} diff --git a/test/Analysis/CFLAliasAnalysis/va.ll b/test/Analysis/CFLAliasAnalysis/va.ll new file mode 100644 index 000000000000..3094cb0967f6 --- /dev/null +++ b/test/Analysis/CFLAliasAnalysis/va.ll @@ -0,0 +1,29 @@ +; RUN: opt < %s -cfl-aa -aa-eval -print-may-aliases -disable-output 2>&1 | FileCheck %s + +; CHECK-LABEL: Function: test1 +; CHECK: 0 no alias responses + +define i32 @test1(i32 %X, ...) { + ; Initialize variable argument processing + %ap = alloca i8* + %ap2 = bitcast i8** %ap to i8* + call void @llvm.va_start(i8* %ap2) + + ; Read a single integer argument + %tmp = va_arg i8** %ap, i32 + + ; Demonstrate usage of llvm.va_copy and llvm.va_end + %aq = alloca i8* + %aq2 = bitcast i8** %aq to i8* + call void @llvm.va_copy(i8* %aq2, i8* %ap2) + call void @llvm.va_end(i8* %aq2) + + ; Stop processing of arguments. + call void @llvm.va_end(i8* %ap2) + ret i32 %tmp +} + +declare void @llvm.va_start(i8*) +declare void @llvm.va_copy(i8*, i8*) +declare void @llvm.va_end(i8*) + diff --git a/test/Analysis/CostModel/ARM/cast.ll b/test/Analysis/CostModel/ARM/cast.ll index 662110f2720d..18d6e841433f 100644 --- a/test/Analysis/CostModel/ARM/cast.ll +++ b/test/Analysis/CostModel/ARM/cast.ll @@ -221,35 +221,35 @@ define i32 @casts() { %r96 = fptoui <2 x float> undef to <2 x i32> ; CHECK: cost of 1 {{.*}} fptosi %r97 = fptosi <2 x float> undef to <2 x i32> - ; CHECK: cost of 28 {{.*}} fptoui + ; CHECK: cost of 32 {{.*}} fptoui %r98 = fptoui <2 x float> undef to <2 x i64> - ; CHECK: cost of 28 {{.*}} fptosi + ; CHECK: cost of 32 {{.*}} fptosi %r99 = fptosi <2 x float> undef to <2 x i64> - ; CHECK: cost of 8 {{.*}} fptoui + ; CHECK: cost of 16 {{.*}} fptoui %r100 = fptoui <2 x double> undef to <2 x i1> - ; CHECK: cost of 8 {{.*}} fptosi + ; CHECK: cost of 16 {{.*}} fptosi %r101 = fptosi <2 x double> undef to <2 x i1> - ; CHECK: cost of 8 {{.*}} fptoui + ; CHECK: cost of 16 {{.*}} fptoui %r102 = fptoui <2 x double> undef to <2 x i8> - ; CHECK: cost of 8 {{.*}} fptosi + ; CHECK: cost of 16 {{.*}} fptosi %r103 = fptosi <2 x double> undef to <2 x i8> - ; CHECK: cost of 8 {{.*}} fptoui + ; CHECK: cost of 16 {{.*}} fptoui %r104 = fptoui <2 x double> undef to <2 x i16> - ; CHECK: cost of 8 {{.*}} fptosi + ; CHECK: cost of 16 {{.*}} fptosi %r105 = fptosi <2 x double> undef to <2 x i16> ; CHECK: cost of 2 {{.*}} fptoui %r106 = fptoui <2 x double> undef to <2 x i32> ; CHECK: cost of 2 {{.*}} fptosi %r107 = fptosi <2 x double> undef to <2 x i32> - ; CHECK: cost of 28 {{.*}} fptoui + ; CHECK: cost of 32 {{.*}} fptoui %r108 = fptoui <2 x double> undef to <2 x i64> - ; CHECK: cost of 28 {{.*}} fptosi + ; CHECK: cost of 32 {{.*}} fptosi %r109 = fptosi <2 x double> undef to <2 x i64> - ; CHECK: cost of 16 {{.*}} fptoui + ; CHECK: cost of 32 {{.*}} fptoui %r110 = fptoui <4 x float> undef to <4 x i1> - ; CHECK: cost of 16 {{.*}} fptosi + ; CHECK: cost of 32 {{.*}} fptosi %r111 = fptosi <4 x float> undef to <4 x i1> ; CHECK: cost of 3 {{.*}} fptoui %r112 = fptoui <4 x float> undef to <4 x i8> @@ -263,39 +263,39 @@ define i32 @casts() { %r116 = fptoui <4 x float> undef to <4 x i32> ; CHECK: cost of 1 {{.*}} fptosi %r117 = fptosi <4 x float> undef to <4 x i32> - ; CHECK: cost of 56 {{.*}} fptoui + ; CHECK: cost of 64 {{.*}} fptoui %r118 = fptoui <4 x float> undef to <4 x i64> - ; CHECK: cost of 56 {{.*}} fptosi + ; CHECK: cost of 64 {{.*}} fptosi %r119 = fptosi <4 x float> undef to <4 x i64> - ; CHECK: cost of 16 {{.*}} fptoui + ; CHECK: cost of 32 {{.*}} fptoui %r120 = fptoui <4 x double> undef to <4 x i1> - ; CHECK: cost of 16 {{.*}} fptosi + ; CHECK: cost of 32 {{.*}} fptosi %r121 = fptosi <4 x double> undef to <4 x i1> - ; CHECK: cost of 16 {{.*}} fptoui + ; CHECK: cost of 32 {{.*}} fptoui %r122 = fptoui <4 x double> undef to <4 x i8> - ; CHECK: cost of 16 {{.*}} fptosi + ; CHECK: cost of 32 {{.*}} fptosi %r123 = fptosi <4 x double> undef to <4 x i8> - ; CHECK: cost of 16 {{.*}} fptoui + ; CHECK: cost of 32 {{.*}} fptoui %r124 = fptoui <4 x double> undef to <4 x i16> - ; CHECK: cost of 16 {{.*}} fptosi + ; CHECK: cost of 32 {{.*}} fptosi %r125 = fptosi <4 x double> undef to <4 x i16> - ; CHECK: cost of 16 {{.*}} fptoui + ; CHECK: cost of 32 {{.*}} fptoui %r126 = fptoui <4 x double> undef to <4 x i32> - ; CHECK: cost of 16 {{.*}} fptosi + ; CHECK: cost of 32 {{.*}} fptosi %r127 = fptosi <4 x double> undef to <4 x i32> - ; CHECK: cost of 56 {{.*}} fptoui + ; CHECK: cost of 64 {{.*}} fptoui %r128 = fptoui <4 x double> undef to <4 x i64> - ; CHECK: cost of 56 {{.*}} fptosi + ; CHECK: cost of 64 {{.*}} fptosi %r129 = fptosi <4 x double> undef to <4 x i64> - ; CHECK: cost of 32 {{.*}} fptoui + ; CHECK: cost of 64 {{.*}} fptoui %r130 = fptoui <8 x float> undef to <8 x i1> - ; CHECK: cost of 32 {{.*}} fptosi + ; CHECK: cost of 64 {{.*}} fptosi %r131 = fptosi <8 x float> undef to <8 x i1> - ; CHECK: cost of 32 {{.*}} fptoui + ; CHECK: cost of 64 {{.*}} fptoui %r132 = fptoui <8 x float> undef to <8 x i8> - ; CHECK: cost of 32 {{.*}} fptosi + ; CHECK: cost of 64 {{.*}} fptosi %r133 = fptosi <8 x float> undef to <8 x i8> ; CHECK: cost of 4 {{.*}} fptoui %r134 = fptoui <8 x float> undef to <8 x i16> @@ -305,39 +305,39 @@ define i32 @casts() { %r136 = fptoui <8 x float> undef to <8 x i32> ; CHECK: cost of 2 {{.*}} fptosi %r137 = fptosi <8 x float> undef to <8 x i32> - ; CHECK: cost of 112 {{.*}} fptoui + ; CHECK: cost of 128 {{.*}} fptoui %r138 = fptoui <8 x float> undef to <8 x i64> - ; CHECK: cost of 112 {{.*}} fptosi + ; CHECK: cost of 128 {{.*}} fptosi %r139 = fptosi <8 x float> undef to <8 x i64> - ; CHECK: cost of 32 {{.*}} fptoui + ; CHECK: cost of 64 {{.*}} fptoui %r140 = fptoui <8 x double> undef to <8 x i1> - ; CHECK: cost of 32 {{.*}} fptosi + ; CHECK: cost of 64 {{.*}} fptosi %r141 = fptosi <8 x double> undef to <8 x i1> - ; CHECK: cost of 32 {{.*}} fptoui + ; CHECK: cost of 64 {{.*}} fptoui %r142 = fptoui <8 x double> undef to <8 x i8> - ; CHECK: cost of 32 {{.*}} fptosi + ; CHECK: cost of 64 {{.*}} fptosi %r143 = fptosi <8 x double> undef to <8 x i8> - ; CHECK: cost of 32 {{.*}} fptoui + ; CHECK: cost of 64 {{.*}} fptoui %r144 = fptoui <8 x double> undef to <8 x i16> - ; CHECK: cost of 32 {{.*}} fptosi + ; CHECK: cost of 64 {{.*}} fptosi %r145 = fptosi <8 x double> undef to <8 x i16> - ; CHECK: cost of 32 {{.*}} fptoui + ; CHECK: cost of 64 {{.*}} fptoui %r146 = fptoui <8 x double> undef to <8 x i32> - ; CHECK: cost of 32 {{.*}} fptosi + ; CHECK: cost of 64 {{.*}} fptosi %r147 = fptosi <8 x double> undef to <8 x i32> - ; CHECK: cost of 112 {{.*}} fptoui + ; CHECK: cost of 128 {{.*}} fptoui %r148 = fptoui <8 x double> undef to <8 x i64> - ; CHECK: cost of 112 {{.*}} fptosi + ; CHECK: cost of 128 {{.*}} fptosi %r149 = fptosi <8 x double> undef to <8 x i64> - ; CHECK: cost of 64 {{.*}} fptoui + ; CHECK: cost of 128 {{.*}} fptoui %r150 = fptoui <16 x float> undef to <16 x i1> - ; CHECK: cost of 64 {{.*}} fptosi + ; CHECK: cost of 128 {{.*}} fptosi %r151 = fptosi <16 x float> undef to <16 x i1> - ; CHECK: cost of 64 {{.*}} fptoui + ; CHECK: cost of 128 {{.*}} fptoui %r152 = fptoui <16 x float> undef to <16 x i8> - ; CHECK: cost of 64 {{.*}} fptosi + ; CHECK: cost of 128 {{.*}} fptosi %r153 = fptosi <16 x float> undef to <16 x i8> ; CHECK: cost of 8 {{.*}} fptoui %r154 = fptoui <16 x float> undef to <16 x i16> @@ -347,30 +347,30 @@ define i32 @casts() { %r156 = fptoui <16 x float> undef to <16 x i32> ; CHECK: cost of 4 {{.*}} fptosi %r157 = fptosi <16 x float> undef to <16 x i32> - ; CHECK: cost of 224 {{.*}} fptoui + ; CHECK: cost of 256 {{.*}} fptoui %r158 = fptoui <16 x float> undef to <16 x i64> - ; CHECK: cost of 224 {{.*}} fptosi + ; CHECK: cost of 256 {{.*}} fptosi %r159 = fptosi <16 x float> undef to <16 x i64> - ; CHECK: cost of 64 {{.*}} fptoui + ; CHECK: cost of 128 {{.*}} fptoui %r160 = fptoui <16 x double> undef to <16 x i1> - ; CHECK: cost of 64 {{.*}} fptosi + ; CHECK: cost of 128 {{.*}} fptosi %r161 = fptosi <16 x double> undef to <16 x i1> - ; CHECK: cost of 64 {{.*}} fptoui + ; CHECK: cost of 128 {{.*}} fptoui %r162 = fptoui <16 x double> undef to <16 x i8> - ; CHECK: cost of 64 {{.*}} fptosi + ; CHECK: cost of 128 {{.*}} fptosi %r163 = fptosi <16 x double> undef to <16 x i8> - ; CHECK: cost of 64 {{.*}} fptoui + ; CHECK: cost of 128 {{.*}} fptoui %r164 = fptoui <16 x double> undef to <16 x i16> - ; CHECK: cost of 64 {{.*}} fptosi + ; CHECK: cost of 128 {{.*}} fptosi %r165 = fptosi <16 x double> undef to <16 x i16> - ; CHECK: cost of 64 {{.*}} fptoui + ; CHECK: cost of 128 {{.*}} fptoui %r166 = fptoui <16 x double> undef to <16 x i32> - ; CHECK: cost of 64 {{.*}} fptosi + ; CHECK: cost of 128 {{.*}} fptosi %r167 = fptosi <16 x double> undef to <16 x i32> - ; CHECK: cost of 224 {{.*}} fptoui + ; CHECK: cost of 256 {{.*}} fptoui %r168 = fptoui <16 x double> undef to <16 x i64> - ; CHECK: cost of 224 {{.*}} fptosi + ; CHECK: cost of 256 {{.*}} fptosi %r169 = fptosi <16 x double> undef to <16 x i64> ; CHECK: cost of 8 {{.*}} uitofp diff --git a/test/Analysis/CostModel/PowerPC/cmp-expanded.ll b/test/Analysis/CostModel/PowerPC/cmp-expanded.ll new file mode 100644 index 000000000000..38c8439b9fb6 --- /dev/null +++ b/test/Analysis/CostModel/PowerPC/cmp-expanded.ll @@ -0,0 +1,14 @@ +; RUN: opt < %s -cost-model -analyze -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 -mattr=-vsx | FileCheck %s +target datalayout = "E-m:e-i64:64-n32:64" +target triple = "powerpc64-unknown-linux-gnu" + +define void @exts() { + + ; VSX is disabled, so this cost needs to include scalarization (because + ; <4 x double> is legalized to scalars). + ; CHECK: cost of 44 {{.*}} fcmp + %v1 = fcmp ugt <4 x double> undef, undef + + ret void +} + diff --git a/test/Analysis/CostModel/X86/cast.ll b/test/Analysis/CostModel/X86/cast.ll index 7f97b176f7c1..fb16af635f07 100644 --- a/test/Analysis/CostModel/X86/cast.ll +++ b/test/Analysis/CostModel/X86/cast.ll @@ -1,3 +1,4 @@ +; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mcpu=knl | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-AVX512 ; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mcpu=core-avx2 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-AVX2 ; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mcpu=corei7-avx | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-AVX @@ -83,6 +84,19 @@ define i32 @zext_sext(<8 x i1> %in) { ;CHECK-AVX: cost of 4 {{.*}} zext %D = zext <4 x i32> undef to <4 x i64> + ;CHECK-AVX512: cost of 3 {{.*}} %D1 = zext + %D1 = zext <16 x i32> undef to <16 x i64> + + ;CHECK-AVX512: cost of 3 {{.*}} %D2 = sext + %D2 = sext <16 x i32> undef to <16 x i64> + + ;CHECK-AVX512: cost of 1 {{.*}} %D3 = zext + %D3 = zext <16 x i16> undef to <16 x i32> + ;CHECK-AVX512: cost of 1 {{.*}} %D4 = zext + %D4 = zext <16 x i8> undef to <16 x i32> + ;CHECK-AVX512: cost of 2 {{.*}} %D5 = zext + %D5 = zext <16 x i1> undef to <16 x i32> + ;CHECK-AVX2: cost of 2 {{.*}} trunc ;CHECK-AVX: cost of 4 {{.*}} trunc %E = trunc <4 x i64> undef to <4 x i32> @@ -101,8 +115,12 @@ define i32 @zext_sext(<8 x i1> %in) { ;CHECK-AVX2: cost of 4 {{.*}} trunc ;CHECK-AVX: cost of 9 {{.*}} trunc + ;CHECK_AVX512: cost of 1 {{.*}} G = trunc %G = trunc <8 x i64> undef to <8 x i32> + ;CHECK-AVX512: cost of 4 {{.*}} %G1 = trunc + %G1 = trunc <16 x i64> undef to <16 x i32> + ret i32 undef } @@ -207,7 +225,30 @@ define void @uitofp8(<8 x i1> %a, <8 x i8> %b, <8 x i16> %c, <8 x i32> %d) { ; CHECK: cost of 5 {{.*}} uitofp %C1 = uitofp <8 x i16> %c to <8 x float> - ; CHECK: cost of 9 {{.*}} uitofp + ; CHECK-AVX2: cost of 8 {{.*}} uitofp + ; CHECK-AVX512: cost of 8 {{.*}} uitofp + ; CHECK-AVX: cost of 9 {{.*}} uitofp %D1 = uitofp <8 x i32> %d to <8 x float> ret void } + +define void @fp_conv(<8 x float> %a, <16 x float>%b) { +;CHECK-LABEL: for function 'fp_conv' + ; CHECK-AVX512: cost of 1 {{.*}} fpext + %A1 = fpext <8 x float> %a to <8 x double> + + ; CHECK-AVX512: cost of 3 {{.*}} fpext + %A2 = fpext <16 x float> %b to <16 x double> + + ; CHECK-AVX2: cost of 3 {{.*}} %A3 = fpext + ; CHECK-AVX512: cost of 1 {{.*}} %A3 = fpext + %A3 = fpext <8 x float> %a to <8 x double> + + ; CHECK-AVX2: cost of 3 {{.*}} %A4 = fptrunc + ; CHECK-AVX512: cost of 1 {{.*}} %A4 = fptrunc + %A4 = fptrunc <8 x double> undef to <8 x float> + + ; CHECK-AVX512: cost of 3 {{.*}} %A5 = fptrunc + %A5 = fptrunc <16 x double> undef to <16 x float> + ret void +} diff --git a/test/Analysis/CostModel/X86/cmp.ll b/test/Analysis/CostModel/X86/cmp.ll index 9f2bdb3c21b7..469cd735f8a0 100644 --- a/test/Analysis/CostModel/X86/cmp.ll +++ b/test/Analysis/CostModel/X86/cmp.ll @@ -1,5 +1,6 @@ ; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mcpu=corei7-avx | FileCheck -check-prefix=CHECK -check-prefix=AVX1 %s ; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mcpu=core-avx2 | FileCheck -check-prefix=CHECK -check-prefix=AVX2 %s +; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mcpu=knl | FileCheck -check-prefix=CHECK -check-prefix=AVX512 %s target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" target triple = "x86_64-apple-macosx10.8.0" @@ -22,6 +23,11 @@ define i32 @cmp(i32 %arg) { ;AVX2: cost of 1 {{.*}} fcmp %E = fcmp olt <4 x double> undef, undef + ; AVX512: cost of 1 {{.*}} %E1 = fcmp + %E1 = fcmp olt <16 x float> undef, undef + ; AVX512: cost of 2 {{.*}} %E2 = fcmp + %E2 = fcmp olt <16 x double> undef, undef + ; -- integers -- ;AVX1: cost of 1 {{.*}} icmp @@ -49,6 +55,11 @@ define i32 @cmp(i32 %arg) { ;AVX2: cost of 1 {{.*}} icmp %M = icmp eq <32 x i8> undef, undef + ; AVX512: cost of 1 {{.*}} %M1 = icmp + %M1 = icmp eq <16 x i32> undef, undef + ; AVX512: cost of 2 {{.*}} %M2 = icmp + %M2 = icmp eq <16 x i64> undef, undef + ;CHECK: cost of 0 {{.*}} ret ret i32 undef } diff --git a/test/Analysis/CostModel/X86/sitofp.ll b/test/Analysis/CostModel/X86/sitofp.ll index 338d97416526..edc937ecf946 100644 --- a/test/Analysis/CostModel/X86/sitofp.ll +++ b/test/Analysis/CostModel/X86/sitofp.ll @@ -1,4 +1,5 @@ ; RUN: opt -mtriple=x86_64-apple-darwin -mcpu=core2 -cost-model -analyze < %s | FileCheck --check-prefix=SSE2 %s +; RUN: opt -mtriple=x86_64-apple-darwin -mcpu=knl -cost-model -analyze < %s | FileCheck --check-prefix=AVX512F %s define <2 x double> @sitofpv2i8v2double(<2 x i8> %a) { ; SSE2: sitofpv2i8v2double @@ -279,3 +280,47 @@ define <32 x float> @sitofpv32i64v32float(<32 x i64> %a) { %1 = sitofp <32 x i64> %a to <32 x float> ret <32 x float> %1 } + +; AVX512F-LABEL: sitofp_16i8_float +; AVX512F: cost of 2 {{.*}} sitofp +define <16 x float> @sitofp_16i8_float(<16 x i8> %a) { + %1 = sitofp <16 x i8> %a to <16 x float> + ret <16 x float> %1 +} + +define <16 x float> @sitofp_16i16_float(<16 x i16> %a) { + ; AVX512F-LABEL: sitofp_16i16_float + ; AVX512F: cost of 2 {{.*}} sitofp + %1 = sitofp <16 x i16> %a to <16 x float> + ret <16 x float> %1 +} + +; AVX512F-LABEL: sitofp_8i8_double +; AVX512F: cost of 2 {{.*}} sitofp +define <8 x double> @sitofp_8i8_double(<8 x i8> %a) { + %1 = sitofp <8 x i8> %a to <8 x double> + ret <8 x double> %1 +} + +; AVX512F-LABEL: sitofp_8i16_double +; AVX512F: cost of 2 {{.*}} sitofp +define <8 x double> @sitofp_8i16_double(<8 x i16> %a) { + %1 = sitofp <8 x i16> %a to <8 x double> + ret <8 x double> %1 +} + +; AVX512F-LABEL: sitofp_8i1_double +; AVX512F: cost of 4 {{.*}} sitofp +define <8 x double> @sitofp_8i1_double(<8 x double> %a) { + %cmpres = fcmp ogt <8 x double> %a, zeroinitializer + %1 = sitofp <8 x i1> %cmpres to <8 x double> + ret <8 x double> %1 +} + +; AVX512F-LABEL: sitofp_16i1_float +; AVX512F: cost of 3 {{.*}} sitofp +define <16 x float> @sitofp_16i1_float(<16 x float> %a) { + %cmpres = fcmp ogt <16 x float> %a, zeroinitializer + %1 = sitofp <16 x i1> %cmpres to <16 x float> + ret <16 x float> %1 +} diff --git a/test/Analysis/CostModel/X86/uitofp.ll b/test/Analysis/CostModel/X86/uitofp.ll index a41a04df84ec..27ec268b42a8 100644 --- a/test/Analysis/CostModel/X86/uitofp.ll +++ b/test/Analysis/CostModel/X86/uitofp.ll @@ -235,7 +235,7 @@ define <2 x float> @uitofpv2i8v2float(<2 x i8> %a) { define <4 x float> @uitofpv4i8v4float(<4 x i8> %a) { ; SSE2: uitofpv4i8v4float - ; SSE2: cost of 15 {{.*}} uitofp + ; SSE2: cost of 8 {{.*}} uitofp %1 = uitofp <4 x i8> %a to <4 x float> ret <4 x float> %1 } @@ -270,7 +270,7 @@ define <2 x float> @uitofpv2i16v2float(<2 x i16> %a) { define <4 x float> @uitofpv4i16v4float(<4 x i16> %a) { ; SSE2: uitofpv4i16v4float - ; SSE2: cost of 15 {{.*}} uitofp + ; SSE2: cost of 8 {{.*}} uitofp %1 = uitofp <4 x i16> %a to <4 x float> ret <4 x float> %1 } @@ -305,28 +305,28 @@ define <2 x float> @uitofpv2i32v2float(<2 x i32> %a) { define <4 x float> @uitofpv4i32v4float(<4 x i32> %a) { ; SSE2: uitofpv4i32v4float - ; SSE2: cost of 15 {{.*}} uitofp + ; SSE2: cost of 8 {{.*}} uitofp %1 = uitofp <4 x i32> %a to <4 x float> ret <4 x float> %1 } define <8 x float> @uitofpv8i32v8float(<8 x i32> %a) { ; SSE2: uitofpv8i32v8float - ; SSE2: cost of 30 {{.*}} uitofp + ; SSE2: cost of 16 {{.*}} uitofp %1 = uitofp <8 x i32> %a to <8 x float> ret <8 x float> %1 } define <16 x float> @uitofpv16i32v16float(<16 x i32> %a) { ; SSE2: uitofpv16i32v16float - ; SSE2: cost of 60 {{.*}} uitofp + ; SSE2: cost of 32 {{.*}} uitofp %1 = uitofp <16 x i32> %a to <16 x float> ret <16 x float> %1 } define <32 x float> @uitofpv32i32v32float(<32 x i32> %a) { ; SSE2: uitofpv32i32v32float - ; SSE2: cost of 120 {{.*}} uitofp + ; SSE2: cost of 64 {{.*}} uitofp %1 = uitofp <32 x i32> %a to <32 x float> ret <32 x float> %1 } diff --git a/test/Analysis/DependenceAnalysis/NonCanonicalizedSubscript.ll b/test/Analysis/DependenceAnalysis/NonCanonicalizedSubscript.ll new file mode 100644 index 000000000000..95e5e52bc2a7 --- /dev/null +++ b/test/Analysis/DependenceAnalysis/NonCanonicalizedSubscript.ll @@ -0,0 +1,40 @@ +; RUN: opt < %s -analyze -basicaa -da -da-delinearize=false | FileCheck %s +; RUN: opt < %s -analyze -basicaa -da -da-delinearize | FileCheck %s -check-prefix=DELIN + +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" +target triple = "x86_64-apple-macosx10.6.0" + +; for (int i = 0; i < 100; ++i) { +; int t0 = a[i][i]; +; int t1 = t0 + 1; +; a[i][5] = t1; +; } +; The subscript 5 in a[i][5] is deliberately an i32, mismatching the types of +; other subscript. DependenceAnalysis before the fix crashed due to this +; mismatch. +define void @i32_subscript([100 x [100 x i32]]* %a, i32* %b) { +; CHECK-LABEL: 'Dependence Analysis' for function 'i32_subscript' +; DELIN-LABEL: 'Dependence Analysis' for function 'i32_subscript' +entry: + br label %for.body + +for.body: +; CHECK: da analyze - none! +; CHECK: da analyze - anti [=|<]! +; CHECK: da analyze - none! +; DELIN: da analyze - none! +; DELIN: da analyze - anti [=|<]! +; DELIN: da analyze - none! + %i = phi i64 [ 0, %entry ], [ %i.inc, %for.body ] + %a.addr = getelementptr [100 x [100 x i32]]* %a, i64 0, i64 %i, i64 %i + %a.addr.2 = getelementptr [100 x [100 x i32]]* %a, i64 0, i64 %i, i32 5 + %0 = load i32* %a.addr, align 4 + %1 = add i32 %0, 1 + store i32 %1, i32* %a.addr.2, align 4 + %i.inc = add nsw i64 %i, 1 + %exitcond = icmp ne i64 %i.inc, 100 + br i1 %exitcond, label %for.body, label %for.end + +for.end: + ret void +} diff --git a/test/Analysis/Dominators/basic.ll b/test/Analysis/Dominators/basic.ll new file mode 100644 index 000000000000..353c3397b5da --- /dev/null +++ b/test/Analysis/Dominators/basic.ll @@ -0,0 +1,60 @@ +; RUN: opt < %s -domtree -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=CHECK-OLDPM +; RUN: opt < %s -disable-output -passes='print<domtree>' 2>&1 | FileCheck %s -check-prefix=CHECK -check-prefix=CHECK-NEWPM + +define void @test1() { +; CHECK-OLDPM-LABEL: 'Dominator Tree Construction' for function 'test1': +; CHECK-NEWPM-LABEL: DominatorTree for function: test1 +; CHECK: [1] %entry +; CHECK-NEXT: [2] %a +; CHECK-NEXT: [2] %c +; CHECK-NEXT: [3] %d +; CHECK-NEXT: [3] %e +; CHECK-NEXT: [2] %b + +entry: + br i1 undef, label %a, label %b + +a: + br label %c + +b: + br label %c + +c: + br i1 undef, label %d, label %e + +d: + ret void + +e: + ret void +} + +define void @test2() { +; CHECK-OLDPM-LABEL: 'Dominator Tree Construction' for function 'test2': +; CHECK-NEWPM-LABEL: DominatorTree for function: test2 +; CHECK: [1] %entry +; CHECK-NEXT: [2] %a +; CHECK-NEXT: [3] %b +; CHECK-NEXT: [4] %c +; CHECK-NEXT: [5] %d +; CHECK-NEXT: [5] %ret + +entry: + br label %a + +a: + br label %b + +b: + br i1 undef, label %a, label %c + +c: + br i1 undef, label %d, label %ret + +d: + br i1 undef, label %a, label %ret + +ret: + ret void +} diff --git a/test/Analysis/GlobalsModRef/pr12351.ll b/test/Analysis/GlobalsModRef/pr12351.ll index 1c5ac43f8d27..c221f4c087f8 100644 --- a/test/Analysis/GlobalsModRef/pr12351.ll +++ b/test/Analysis/GlobalsModRef/pr12351.ll @@ -26,8 +26,8 @@ define i32 @foo2() { define void @bar2(i32* %foo) { store i32 0, i32* %foo, align 4 - tail call void @llvm.dbg.value(metadata !{}, i64 0, metadata !{}) + tail call void @llvm.dbg.value(metadata !{}, i64 0, metadata !{}, metadata !{}) ret void } -declare void @llvm.dbg.value(metadata, i64, metadata) nounwind readnone +declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone diff --git a/test/Analysis/ScalarEvolution/load-with-range-metadata.ll b/test/Analysis/ScalarEvolution/load-with-range-metadata.ll new file mode 100644 index 000000000000..32c1074b1742 --- /dev/null +++ b/test/Analysis/ScalarEvolution/load-with-range-metadata.ll @@ -0,0 +1,37 @@ +; RUN: opt -analyze -scalar-evolution < %s | FileCheck %s + +define i32 @slt_trip_count_with_range(i32 *%ptr0, i32 *%ptr1) { +; CHECK-LABEL: slt_trip_count_with_range + entry: + %limit = load i32* %ptr0, !range !0 + br label %loop + + loop: +; CHECK: Loop %loop: max backedge-taken count is 98 + %index = phi i32 [ 0, %entry ], [ %index.inc, %loop ] + %index.inc = add i32 %index, 1 + %continue = icmp slt i32 %index.inc, %limit + br i1 %continue, label %loop, label %loop.exit + + loop.exit: + ret i32 0 +} + +define i32 @ult_trip_count_with_range(i32 *%ptr0, i32 *%ptr1) { +; CHECK-LABEL: ult_trip_count_with_range + entry: + %limit = load i32* %ptr0, !range !0 + br label %loop + + loop: +; CHECK: Loop %loop: max backedge-taken count is 98 + %index = phi i32 [ 0, %entry ], [ %index.inc, %loop ] + %index.inc = add i32 %index, 1 + %continue = icmp ult i32 %index.inc, %limit + br i1 %continue, label %loop, label %loop.exit + + loop.exit: + ret i32 0 +} + +!0 = !{i32 1, i32 100} diff --git a/test/Analysis/ScalarEvolution/nsw-offset-assume.ll b/test/Analysis/ScalarEvolution/nsw-offset-assume.ll new file mode 100644 index 000000000000..29cf65857797 --- /dev/null +++ b/test/Analysis/ScalarEvolution/nsw-offset-assume.ll @@ -0,0 +1,83 @@ +; RUN: opt < %s -S -analyze -scalar-evolution | FileCheck %s + +; ScalarEvolution should be able to fold away the sign-extensions +; on this loop with a primary induction variable incremented with +; a nsw add of 2 (this test is derived from the nsw-offset.ll test, but uses an +; assume instead of a preheader conditional branch to guard the loop). + +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128" + +define void @foo(i32 %no, double* nocapture %d, double* nocapture %q) nounwind { +entry: + %n = and i32 %no, 4294967294 + %0 = icmp sgt i32 %n, 0 ; <i1> [#uses=1] + tail call void @llvm.assume(i1 %0) + br label %bb.nph + +bb.nph: ; preds = %entry + br label %bb + +bb: ; preds = %bb.nph, %bb1 + %i.01 = phi i32 [ %16, %bb1 ], [ 0, %bb.nph ] ; <i32> [#uses=5] + +; CHECK: %1 = sext i32 %i.01 to i64 +; CHECK: --> {0,+,2}<nuw><nsw><%bb> + %1 = sext i32 %i.01 to i64 ; <i64> [#uses=1] + +; CHECK: %2 = getelementptr inbounds double* %d, i64 %1 +; CHECK: --> {%d,+,16}<nsw><%bb> + %2 = getelementptr inbounds double* %d, i64 %1 ; <double*> [#uses=1] + + %3 = load double* %2, align 8 ; <double> [#uses=1] + %4 = sext i32 %i.01 to i64 ; <i64> [#uses=1] + %5 = getelementptr inbounds double* %q, i64 %4 ; <double*> [#uses=1] + %6 = load double* %5, align 8 ; <double> [#uses=1] + %7 = or i32 %i.01, 1 ; <i32> [#uses=1] + +; CHECK: %8 = sext i32 %7 to i64 +; CHECK: --> {1,+,2}<nuw><nsw><%bb> + %8 = sext i32 %7 to i64 ; <i64> [#uses=1] + +; CHECK: %9 = getelementptr inbounds double* %q, i64 %8 +; CHECK: {(8 + %q),+,16}<nsw><%bb> + %9 = getelementptr inbounds double* %q, i64 %8 ; <double*> [#uses=1] + +; Artificially repeat the above three instructions, this time using +; add nsw instead of or. + %t7 = add nsw i32 %i.01, 1 ; <i32> [#uses=1] + +; CHECK: %t8 = sext i32 %t7 to i64 +; CHECK: --> {1,+,2}<nuw><nsw><%bb> + %t8 = sext i32 %t7 to i64 ; <i64> [#uses=1] + +; CHECK: %t9 = getelementptr inbounds double* %q, i64 %t8 +; CHECK: {(8 + %q),+,16}<nsw><%bb> + %t9 = getelementptr inbounds double* %q, i64 %t8 ; <double*> [#uses=1] + + %10 = load double* %9, align 8 ; <double> [#uses=1] + %11 = fadd double %6, %10 ; <double> [#uses=1] + %12 = fadd double %11, 3.200000e+00 ; <double> [#uses=1] + %13 = fmul double %3, %12 ; <double> [#uses=1] + %14 = sext i32 %i.01 to i64 ; <i64> [#uses=1] + %15 = getelementptr inbounds double* %d, i64 %14 ; <double*> [#uses=1] + store double %13, double* %15, align 8 + %16 = add nsw i32 %i.01, 2 ; <i32> [#uses=2] + br label %bb1 + +bb1: ; preds = %bb + %17 = icmp slt i32 %16, %n ; <i1> [#uses=1] + br i1 %17, label %bb, label %bb1.return_crit_edge + +bb1.return_crit_edge: ; preds = %bb1 + br label %return + +return: ; preds = %bb1.return_crit_edge, %entry + ret void +} + +declare void @llvm.assume(i1) nounwind + +; Note: Without the preheader assume, there is an 'smax' in the +; backedge-taken count expression: +; CHECK: Loop %bb: backedge-taken count is ((-1 + (2 * (%no /u 2))) /u 2) +; CHECK: Loop %bb: max backedge-taken count is 1073741822 diff --git a/test/Analysis/ScalarEvolution/nsw.ll b/test/Analysis/ScalarEvolution/nsw.ll index 05992eadbac0..d776a5a5da78 100644 --- a/test/Analysis/ScalarEvolution/nsw.ll +++ b/test/Analysis/ScalarEvolution/nsw.ll @@ -123,9 +123,8 @@ exit: ret i32 %result } -; TODO: This could fold down to '1' ; CHECK-LABEL: PR12375 -; CHECK: --> {(4 + %arg),+,4}<nuw><%bb1> Exits: (4 + (4 * ((-1 + (-1 * %arg) + ((4 + %arg) umax (8 + %arg)<nsw>)) /u 4)) + %arg) +; CHECK: --> {(4 + %arg),+,4}<nuw><%bb1> Exits: (8 + %arg)<nsw> define i32 @PR12375(i32* readnone %arg) { bb: %tmp = getelementptr inbounds i32* %arg, i64 2 @@ -158,3 +157,23 @@ bb2: ; preds = %bb2, %bb bb5: ; preds = %bb2 ret void } + +declare void @f(i32) + +; CHECK-LABEL: nswnowrap +; CHECK: --> {(1 + %v),+,1}<nsw><%for.body> Exits: (2 + %v) +define void @nswnowrap(i32 %v) { +entry: + %add = add nsw i32 %v, 1 + br label %for.body + +for.body: + %i.04 = phi i32 [ %v, %entry ], [ %inc, %for.body ] + %inc = add nsw i32 %i.04, 1 + tail call void @f(i32 %i.04) + %cmp = icmp slt i32 %i.04, %add + br i1 %cmp, label %for.body, label %for.end + +for.end: + ret void +} diff --git a/test/Analysis/ScalarEvolution/pr22179.ll b/test/Analysis/ScalarEvolution/pr22179.ll new file mode 100644 index 000000000000..d9fb5104436e --- /dev/null +++ b/test/Analysis/ScalarEvolution/pr22179.ll @@ -0,0 +1,28 @@ +; RUN: opt -analyze -scalar-evolution < %s | FileCheck %s + +%struct.anon = type { i8 } +%struct.S = type { i32 } + +@a = common global %struct.anon zeroinitializer, align 1 +@b = common global %struct.S zeroinitializer, align 4 + +; Function Attrs: nounwind ssp uwtable +define i32 @main() { +; CHECK-LABEL: Classifying expressions for: @main + store i8 0, i8* getelementptr inbounds (%struct.anon* @a, i64 0, i32 0), align 1 + br label %loop + +loop: + %storemerge1 = phi i8 [ 0, %0 ], [ %inc, %loop ] + %m = load volatile i32* getelementptr inbounds (%struct.S* @b, i64 0, i32 0), align 4 + %inc = add nuw i8 %storemerge1, 1 +; CHECK: %inc = add nuw i8 %storemerge1, 1 +; CHECK-NEXT: --> {1,+,1}<nuw><%loop> +; CHECK-NOT: --> {1,+,1}<nuw><nsw><%loop> + %exitcond = icmp eq i8 %inc, -128 + br i1 %exitcond, label %exit, label %loop + +exit: + store i8 -128, i8* getelementptr inbounds (%struct.anon* @a, i64 0, i32 0), align 1 + ret i32 0 +} diff --git a/test/Analysis/ScalarEvolution/sext-iv-1.ll b/test/Analysis/ScalarEvolution/sext-iv-1.ll index c34596d35af0..a6f70dbff9a0 100644 --- a/test/Analysis/ScalarEvolution/sext-iv-1.ll +++ b/test/Analysis/ScalarEvolution/sext-iv-1.ll @@ -1,5 +1,12 @@ ; RUN: opt < %s -scalar-evolution -analyze \ -; RUN: | grep " --> (sext i. {.*,+,.*}<%bb1> to i64)" | count 5 +; RUN: | FileCheck %s + +; CHECK: --> (sext i{{.}} {{{.*}},+,{{.*}}}<%bb1> to i64) +; CHECK: --> (sext i{{.}} {{{.*}},+,{{.*}}}<%bb1> to i64) +; CHECK: --> (sext i{{.}} {{{.*}},+,{{.*}}}<%bb1> to i64) +; CHECK: --> (sext i{{.}} {{{.*}},+,{{.*}}}<%bb1> to i64) +; CHECK: --> (sext i{{.}} {{{.*}},+,{{.*}}}<%bb1> to i64) +; CHECK-NOT: --> (sext ; Don't convert (sext {...,+,...}) to {sext(...),+,sext(...)} in cases ; where the trip count is not within range. diff --git a/test/Analysis/ScopedNoAliasAA/basic-domains.ll b/test/Analysis/ScopedNoAliasAA/basic-domains.ll new file mode 100644 index 000000000000..7633a6dfcb4c --- /dev/null +++ b/test/Analysis/ScopedNoAliasAA/basic-domains.ll @@ -0,0 +1,57 @@ +; RUN: opt < %s -basicaa -scoped-noalias -aa-eval -evaluate-aa-metadata -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +define void @foo1(float* nocapture %a, float* nocapture readonly %c) #0 { +entry: +; CHECK-LABEL: Function: foo1 + %0 = load float* %c, align 4, !alias.scope !9 + %arrayidx.i = getelementptr inbounds float* %a, i64 5 + store float %0, float* %arrayidx.i, align 4, !noalias !6 + + %1 = load float* %c, align 4, !alias.scope !5 + %arrayidx.i2 = getelementptr inbounds float* %a, i64 15 + store float %1, float* %arrayidx.i2, align 4, !noalias !6 + + %2 = load float* %c, align 4, !alias.scope !6 + %arrayidx.i3 = getelementptr inbounds float* %a, i64 16 + store float %2, float* %arrayidx.i3, align 4, !noalias !5 + + ret void +} + +attributes #0 = { nounwind uwtable } + +!0 = !{!0, !"some domain"} +!1 = !{!1, !"some other domain"} + +; Two scopes (which must be self-referential to avoid being "uniqued"): +!2 = !{!2, !0, !"a scope in dom0"} +!3 = !{!2} + +!4 = !{!4, !0, !"another scope in dom0"} +!5 = !{!4} + +; A list of the two scopes. +!6 = !{!2, !4} + +; Another scope in the second domain +!7 = !{!7, !1, !"another scope in dom1"} +!8 = !{!7} + +; A list of scopes from both domains. +!9 = !{!2, !4, !7} + +; CHECK: NoAlias: %0 = load float* %c, align 4, !alias.scope !0 <-> store float %0, float* %arrayidx.i, align 4, !noalias !6 +; CHECK: NoAlias: %0 = load float* %c, align 4, !alias.scope !0 <-> store float %1, float* %arrayidx.i2, align 4, !noalias !6 +; CHECK: MayAlias: %0 = load float* %c, align 4, !alias.scope !0 <-> store float %2, float* %arrayidx.i3, align 4, !noalias !7 +; CHECK: NoAlias: %1 = load float* %c, align 4, !alias.scope !7 <-> store float %0, float* %arrayidx.i, align 4, !noalias !6 +; CHECK: NoAlias: %1 = load float* %c, align 4, !alias.scope !7 <-> store float %1, float* %arrayidx.i2, align 4, !noalias !6 +; CHECK: NoAlias: %1 = load float* %c, align 4, !alias.scope !7 <-> store float %2, float* %arrayidx.i3, align 4, !noalias !7 +; CHECK: NoAlias: %2 = load float* %c, align 4, !alias.scope !6 <-> store float %0, float* %arrayidx.i, align 4, !noalias !6 +; CHECK: NoAlias: %2 = load float* %c, align 4, !alias.scope !6 <-> store float %1, float* %arrayidx.i2, align 4, !noalias !6 +; CHECK: MayAlias: %2 = load float* %c, align 4, !alias.scope !6 <-> store float %2, float* %arrayidx.i3, align 4, !noalias !7 +; CHECK: NoAlias: store float %1, float* %arrayidx.i2, align 4, !noalias !6 <-> store float %0, float* %arrayidx.i, align 4, !noalias !6 +; CHECK: NoAlias: store float %2, float* %arrayidx.i3, align 4, !noalias !7 <-> store float %0, float* %arrayidx.i, align 4, !noalias !6 +; CHECK: NoAlias: store float %2, float* %arrayidx.i3, align 4, !noalias !7 <-> store float %1, float* %arrayidx.i2, align 4, !noalias !6 + diff --git a/test/Analysis/ScopedNoAliasAA/basic.ll b/test/Analysis/ScopedNoAliasAA/basic.ll new file mode 100644 index 000000000000..bb232b5b6cb6 --- /dev/null +++ b/test/Analysis/ScopedNoAliasAA/basic.ll @@ -0,0 +1,27 @@ +; RUN: opt < %s -basicaa -scoped-noalias -aa-eval -evaluate-aa-metadata -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +define void @foo1(float* nocapture %a, float* nocapture readonly %c) #0 { +entry: +; CHECK-LABEL: Function: foo1 + %0 = load float* %c, align 4, !alias.scope !1 + %arrayidx.i = getelementptr inbounds float* %a, i64 5 + store float %0, float* %arrayidx.i, align 4, !noalias !1 + %1 = load float* %c, align 4 + %arrayidx = getelementptr inbounds float* %a, i64 7 + store float %1, float* %arrayidx, align 4 + ret void + +; CHECK: NoAlias: %0 = load float* %c, align 4, !alias.scope !0 <-> store float %0, float* %arrayidx.i, align 4, !noalias !0 +; CHECK: MayAlias: %0 = load float* %c, align 4, !alias.scope !0 <-> store float %1, float* %arrayidx, align 4 +; CHECK: MayAlias: %1 = load float* %c, align 4 <-> store float %0, float* %arrayidx.i, align 4, !noalias !0 +; CHECK: MayAlias: %1 = load float* %c, align 4 <-> store float %1, float* %arrayidx, align 4 +; CHECK: NoAlias: store float %1, float* %arrayidx, align 4 <-> store float %0, float* %arrayidx.i, align 4, !noalias !0 +} + +attributes #0 = { nounwind uwtable } + +!0 = !{!0, !"some domain"} +!1 = !{!1, !0, !"some scope"} + diff --git a/test/Analysis/ScopedNoAliasAA/basic2.ll b/test/Analysis/ScopedNoAliasAA/basic2.ll new file mode 100644 index 000000000000..a154b13d98bf --- /dev/null +++ b/test/Analysis/ScopedNoAliasAA/basic2.ll @@ -0,0 +1,41 @@ +; RUN: opt < %s -basicaa -scoped-noalias -aa-eval -evaluate-aa-metadata -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +define void @foo2(float* nocapture %a, float* nocapture %b, float* nocapture readonly %c) #0 { +entry: +; CHECK-LABEL: Function: foo2 + %0 = load float* %c, align 4, !alias.scope !0 + %arrayidx.i = getelementptr inbounds float* %a, i64 5 + store float %0, float* %arrayidx.i, align 4, !alias.scope !5, !noalias !4 + %arrayidx1.i = getelementptr inbounds float* %b, i64 8 + store float %0, float* %arrayidx1.i, align 4, !alias.scope !0, !noalias !5 + %1 = load float* %c, align 4 + %arrayidx = getelementptr inbounds float* %a, i64 7 + store float %1, float* %arrayidx, align 4 + ret void + +; CHECK: MayAlias: %0 = load float* %c, align 4, !alias.scope !0 <-> store float %0, float* %arrayidx.i, align 4, !alias.scope !4, !noalia +; CHECK: s !5 +; CHECK: MayAlias: %0 = load float* %c, align 4, !alias.scope !0 <-> store float %0, float* %arrayidx1.i, align 4, !alias.scope !0, !noali +; CHECK: as !4 +; CHECK: MayAlias: %0 = load float* %c, align 4, !alias.scope !0 <-> store float %1, float* %arrayidx, align 4 +; CHECK: MayAlias: %1 = load float* %c, align 4 <-> store float %0, float* %arrayidx.i, align 4, !alias.scope !4, !noalias !5 +; CHECK: MayAlias: %1 = load float* %c, align 4 <-> store float %0, float* %arrayidx1.i, align 4, !alias.scope !0, !noalias !4 +; CHECK: MayAlias: %1 = load float* %c, align 4 <-> store float %1, float* %arrayidx, align 4 +; CHECK: NoAlias: store float %0, float* %arrayidx1.i, align 4, !alias.scope !0, !noalias !4 <-> store float %0, float* %arrayidx.i, align +; CHECK: 4, !alias.scope !4, !noalias !5 +; CHECK: NoAlias: store float %1, float* %arrayidx, align 4 <-> store float %0, float* %arrayidx.i, align 4, !alias.scope !4, !noalias !5 +; CHECK: MayAlias: store float %1, float* %arrayidx, align 4 <-> store float %0, float* %arrayidx1.i, align 4, !alias.scope !0, !noalias ! +; CHECK: 4 +} + +attributes #0 = { nounwind uwtable } + +!0 = !{!1, !3} +!1 = !{!1, !2, !"some scope"} +!2 = !{!2, !"some domain"} +!3 = !{!3, !2, !"some other scope"} +!4 = !{!1} +!5 = !{!3} + diff --git a/test/Analysis/TypeBasedAliasAnalysis/PR17620.ll b/test/Analysis/TypeBasedAliasAnalysis/PR17620.ll index 905113995c30..920d6f56d957 100644 --- a/test/Analysis/TypeBasedAliasAnalysis/PR17620.ll +++ b/test/Analysis/TypeBasedAliasAnalysis/PR17620.ll @@ -32,14 +32,14 @@ attributes #1 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "n !llvm.ident = !{!0} -!0 = metadata !{metadata !"clang version 3.4"} -!1 = metadata !{metadata !2, metadata !2, i64 0} -!2 = metadata !{metadata !"any pointer", metadata !3, i64 0} -!3 = metadata !{metadata !"omnipotent char", metadata !4, i64 0} -!4 = metadata !{metadata !"Simple C/C++ TBAA"} -!5 = metadata !{metadata !6, metadata !2, i64 8} -!6 = metadata !{metadata !"_ZTSN12_GLOBAL__N_11RINS_1FIPi8TreeIterN1I1S1LENS_1KINS_1DIKS2_S3_EEEEE1GEPSD_EE", metadata !7, i64 8} -!7 = metadata !{metadata !"_ZTSN12_GLOBAL__N_11FIPi8TreeIterN1I1S1LENS_1KINS_1DIKS1_S2_EEEEE1GE", metadata !8, i64 0} -!8 = metadata !{metadata !"_ZTSN12_GLOBAL__N_11DIKPi8TreeIterEE", metadata !2, i64 0, metadata !9, i64 8} -!9 = metadata !{metadata !"_ZTS8TreeIter", metadata !2, i64 8, metadata !10, i64 16} -!10 = metadata !{metadata !"bool", metadata !3, i64 0} +!0 = !{!"clang version 3.4"} +!1 = !{!2, !2, i64 0} +!2 = !{!"any pointer", !3, i64 0} +!3 = !{!"omnipotent char", !4, i64 0} +!4 = !{!"Simple C/C++ TBAA"} +!5 = !{!6, !2, i64 8} +!6 = !{!"_ZTSN12_GLOBAL__N_11RINS_1FIPi8TreeIterN1I1S1LENS_1KINS_1DIKS2_S3_EEEEE1GEPSD_EE", !7, i64 8} +!7 = !{!"_ZTSN12_GLOBAL__N_11FIPi8TreeIterN1I1S1LENS_1KINS_1DIKS1_S2_EEEEE1GE", !8, i64 0} +!8 = !{!"_ZTSN12_GLOBAL__N_11DIKPi8TreeIterEE", !2, i64 0, !9, i64 8} +!9 = !{!"_ZTS8TreeIter", !2, i64 8, !10, i64 16} +!10 = !{!"bool", !3, i64 0} diff --git a/test/Analysis/TypeBasedAliasAnalysis/aliastest.ll b/test/Analysis/TypeBasedAliasAnalysis/aliastest.ll index 76a88c859a6b..10da13a8d460 100644 --- a/test/Analysis/TypeBasedAliasAnalysis/aliastest.ll +++ b/test/Analysis/TypeBasedAliasAnalysis/aliastest.ll @@ -45,23 +45,23 @@ define i8 @test1_no(i8* %a, i8* %b) nounwind { } ; Root note. -!0 = metadata !{ } +!0 = !{ } ; Some type. -!1 = metadata !{metadata !7, metadata !7, i64 0} +!1 = !{!7, !7, i64 0} ; Some other non-aliasing type. -!2 = metadata !{metadata !8, metadata !8, i64 0} +!2 = !{!8, !8, i64 0} ; Some type. -!3 = metadata !{metadata !9, metadata !9, i64 0} +!3 = !{!9, !9, i64 0} ; Some type in a different type system. -!4 = metadata !{metadata !10, metadata !10, i64 0} +!4 = !{!10, !10, i64 0} ; Invariant memory. -!5 = metadata !{metadata !11, metadata !11, i64 0, i1 1} +!5 = !{!11, !11, i64 0, i1 1} ; Not invariant memory. -!6 = metadata !{metadata !11, metadata !11, i64 0, i1 0} -!7 = metadata !{ metadata !"foo", metadata !0 } -!8 = metadata !{ metadata !"bar", metadata !0 } -!9 = metadata !{ metadata !"foo", metadata !0 } -!10 = metadata !{ metadata !"bar", metadata !"different" } -!11 = metadata !{ metadata !"qux", metadata !0} +!6 = !{!11, !11, i64 0, i1 0} +!7 = !{ !"foo", !0 } +!8 = !{ !"bar", !0 } +!9 = !{ !"foo", !0 } +!10 = !{ !"bar", !"different" } +!11 = !{ !"qux", !0} diff --git a/test/Analysis/TypeBasedAliasAnalysis/argument-promotion.ll b/test/Analysis/TypeBasedAliasAnalysis/argument-promotion.ll index 14bbeac14d69..31f775e04665 100644 --- a/test/Analysis/TypeBasedAliasAnalysis/argument-promotion.ll +++ b/test/Analysis/TypeBasedAliasAnalysis/argument-promotion.ll @@ -32,8 +32,8 @@ define i32 @callercaller(i32* %Q) { ret i32 %X } -!0 = metadata !{metadata !"test"} -!1 = metadata !{metadata !3, metadata !3, i64 0} -!2 = metadata !{metadata !4, metadata !4, i64 0} -!3 = metadata !{metadata !"green", metadata !0} -!4 = metadata !{metadata !"blue", metadata !0} +!0 = !{!"test"} +!1 = !{!3, !3, i64 0} +!2 = !{!4, !4, i64 0} +!3 = !{!"green", !0} +!4 = !{!"blue", !0} diff --git a/test/Analysis/TypeBasedAliasAnalysis/dse.ll b/test/Analysis/TypeBasedAliasAnalysis/dse.ll index bcf1f2c5275d..09f8feb610a9 100644 --- a/test/Analysis/TypeBasedAliasAnalysis/dse.ll +++ b/test/Analysis/TypeBasedAliasAnalysis/dse.ll @@ -1,4 +1,5 @@ ; RUN: opt < %s -tbaa -basicaa -dse -S | FileCheck %s +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" ; DSE should make use of TBAA. @@ -49,23 +50,23 @@ define i8 @test1_no(i8* %a, i8* %b) nounwind { } ; Root note. -!0 = metadata !{ } +!0 = !{ } ; Some type. -!1 = metadata !{metadata !7, metadata !7, i64 0} +!1 = !{!7, !7, i64 0} ; Some other non-aliasing type. -!2 = metadata !{metadata !8, metadata !8, i64 0} +!2 = !{!8, !8, i64 0} ; Some type. -!3 = metadata !{metadata !9, metadata !9, i64 0} +!3 = !{!9, !9, i64 0} ; Some type in a different type system. -!4 = metadata !{metadata !10, metadata !10, i64 0} +!4 = !{!10, !10, i64 0} ; Invariant memory. -!5 = metadata !{metadata !11, metadata !11, i64 0, i1 1} +!5 = !{!11, !11, i64 0, i1 1} ; Not invariant memory. -!6 = metadata !{metadata !11, metadata !11, i64 0, i1 0} -!7 = metadata !{ metadata !"foo", metadata !0 } -!8 = metadata !{ metadata !"bar", metadata !0 } -!9 = metadata !{ metadata !"foo", metadata !0 } -!10 = metadata !{ metadata !"bar", metadata !"different" } -!11 = metadata !{ metadata !"qux", metadata !0} +!6 = !{!11, !11, i64 0, i1 0} +!7 = !{ !"foo", !0 } +!8 = !{ !"bar", !0 } +!9 = !{ !"foo", !0 } +!10 = !{ !"bar", !"different" } +!11 = !{ !"qux", !0} diff --git a/test/Analysis/TypeBasedAliasAnalysis/dynamic-indices.ll b/test/Analysis/TypeBasedAliasAnalysis/dynamic-indices.ll index 4dc40739edfb..732f5d7cfcbb 100644 --- a/test/Analysis/TypeBasedAliasAnalysis/dynamic-indices.ll +++ b/test/Analysis/TypeBasedAliasAnalysis/dynamic-indices.ll @@ -123,15 +123,15 @@ for.end: ; preds = %for.body ret float %tmp10 } -; CHECK: [[TAG]] = metadata !{metadata [[TYPE_LL:!.*]], metadata [[TYPE_LL]], i64 0} -; CHECK: [[TYPE_LL]] = metadata !{metadata !"long long", metadata {{!.*}}} -!0 = metadata !{metadata !6, metadata !6, i64 0} -!1 = metadata !{metadata !"omnipotent char", metadata !2} -!2 = metadata !{metadata !"Simple C/C++ TBAA", null} -!3 = metadata !{metadata !7, metadata !7, i64 0} -!4 = metadata !{metadata !8, metadata !8, i64 0} -!5 = metadata !{metadata !9, metadata !9, i64 0} -!6 = metadata !{metadata !"short", metadata !1} -!7 = metadata !{metadata !"long long", metadata !1} -!8 = metadata !{metadata !"int", metadata !1} -!9 = metadata !{metadata !"float", metadata !1} +; CHECK: [[TAG]] = !{[[TYPE_LL:!.*]], [[TYPE_LL]], i64 0} +; CHECK: [[TYPE_LL]] = !{!"long long", {{!.*}}} +!0 = !{!6, !6, i64 0} +!1 = !{!"omnipotent char", !2} +!2 = !{!"Simple C/C++ TBAA", null} +!3 = !{!7, !7, i64 0} +!4 = !{!8, !8, i64 0} +!5 = !{!9, !9, i64 0} +!6 = !{!"short", !1} +!7 = !{!"long long", !1} +!8 = !{!"int", !1} +!9 = !{!"float", !1} diff --git a/test/Analysis/TypeBasedAliasAnalysis/functionattrs.ll b/test/Analysis/TypeBasedAliasAnalysis/functionattrs.ll index e9fb9418e704..6c9439afeeab 100644 --- a/test/Analysis/TypeBasedAliasAnalysis/functionattrs.ll +++ b/test/Analysis/TypeBasedAliasAnalysis/functionattrs.ll @@ -77,10 +77,10 @@ declare void @llvm.memcpy.p0i8.p0i8.i64(i8*, i8*, i64, i32, i1) nounwind ; CHECK: attributes #2 = { nounwind readonly } ; Root note. -!0 = metadata !{ } +!0 = !{ } ; Invariant memory. -!1 = metadata !{metadata !3, metadata !3, i64 0, i1 1 } +!1 = !{!3, !3, i64 0, i1 1 } ; Not invariant memory. -!2 = metadata !{metadata !3, metadata !3, i64 0, i1 0 } -!3 = metadata !{ metadata !"foo", metadata !0 } +!2 = !{!3, !3, i64 0, i1 0 } +!3 = !{ !"foo", !0 } diff --git a/test/Analysis/TypeBasedAliasAnalysis/gvn-nonlocal-type-mismatch.ll b/test/Analysis/TypeBasedAliasAnalysis/gvn-nonlocal-type-mismatch.ll index 90e1abbb673a..edea6d02800d 100644 --- a/test/Analysis/TypeBasedAliasAnalysis/gvn-nonlocal-type-mismatch.ll +++ b/test/Analysis/TypeBasedAliasAnalysis/gvn-nonlocal-type-mismatch.ll @@ -46,12 +46,12 @@ entry: br i1 %c, label %if.else, label %if.then if.then: - %t = load i32* %p, !tbaa !4 + %t = load i32* %p, !tbaa !3 store i32 %t, i32* %q ret void if.else: - %u = load i32* %p, !tbaa !3 + %u = load i32* %p, !tbaa !4 store i32 %u, i32* %q ret void } @@ -61,11 +61,11 @@ if.else: ; CHECK: @watch_out_for_another_type_change ; CHECK: if.then: -; CHECK: %t = load i32* %p -; CHECK: store i32 %t, i32* %q +; CHECK: store i32 0, i32* %q ; CHECK: ret void ; CHECK: if.else: -; CHECK: store i32 0, i32* %q +; CHECK: %u = load i32* %p +; CHECK: store i32 %u, i32* %q define void @watch_out_for_another_type_change(i1 %c, i32* %p, i32* %p1, i32* %q) nounwind { entry: @@ -74,22 +74,22 @@ entry: br i1 %c, label %if.else, label %if.then if.then: - %t = load i32* %p, !tbaa !3 + %t = load i32* %p, !tbaa !4 store i32 %t, i32* %q ret void if.else: - %u = load i32* %p, !tbaa !4 + %u = load i32* %p, !tbaa !3 store i32 %u, i32* %q ret void } -!0 = metadata !{} -!1 = metadata !{metadata !5, metadata !5, i64 0} -!2 = metadata !{metadata !6, metadata !6, i64 0} -!3 = metadata !{metadata !7, metadata !7, i64 0} -!4 = metadata !{metadata !8, metadata !8, i64 0} -!5 = metadata !{metadata !"red", metadata !0} -!6 = metadata !{metadata !"blu", metadata !0} -!7 = metadata !{metadata !"outer space"} -!8 = metadata !{metadata !"brick red", metadata !5} +!0 = !{} +!1 = !{!5, !5, i64 0} +!2 = !{!6, !6, i64 0} +!3 = !{!7, !7, i64 0} +!4 = !{!8, !8, i64 0} +!5 = !{!"red", !0} +!6 = !{!"blu", !0} +!7 = !{!"outer space"} +!8 = !{!"brick red", !5} diff --git a/test/Analysis/TypeBasedAliasAnalysis/intrinsics.ll b/test/Analysis/TypeBasedAliasAnalysis/intrinsics.ll index 93b8e503b855..0c12cac27d3a 100644 --- a/test/Analysis/TypeBasedAliasAnalysis/intrinsics.ll +++ b/test/Analysis/TypeBasedAliasAnalysis/intrinsics.ll @@ -25,8 +25,8 @@ declare void @llvm.arm.neon.vst1.v8i16(i8*, <8 x i16>, i32) nounwind ; CHECK: attributes #0 = { nounwind readonly } ; CHECK: attributes [[NUW]] = { nounwind } -!0 = metadata !{metadata !"tbaa root", null} -!1 = metadata !{metadata !3, metadata !3, i64 0} -!2 = metadata !{metadata !4, metadata !4, i64 0} -!3 = metadata !{metadata !"A", metadata !0} -!4 = metadata !{metadata !"B", metadata !0} +!0 = !{!"tbaa root", null} +!1 = !{!3, !3, i64 0} +!2 = !{!4, !4, i64 0} +!3 = !{!"A", !0} +!4 = !{!"B", !0} diff --git a/test/Analysis/TypeBasedAliasAnalysis/licm.ll b/test/Analysis/TypeBasedAliasAnalysis/licm.ll index e45fc85478d3..0722a2ce86a8 100644 --- a/test/Analysis/TypeBasedAliasAnalysis/licm.ll +++ b/test/Analysis/TypeBasedAliasAnalysis/licm.ll @@ -29,9 +29,9 @@ for.end: ; preds = %for.body, %entry ret void } -!0 = metadata !{metadata !"root", null} -!1 = metadata !{metadata !6, metadata !6, i64 0} -!2 = metadata !{metadata !7, metadata !7, i64 0} +!0 = !{!"root", null} +!1 = !{!6, !6, i64 0} +!2 = !{!7, !7, i64 0} ; LICM shouldn't hoist anything here. @@ -56,10 +56,10 @@ loop: br label %loop } -!3 = metadata !{metadata !"pointer", metadata !8} -!4 = metadata !{metadata !8, metadata !8, i64 0} -!5 = metadata !{metadata !9, metadata !9, i64 0} -!6 = metadata !{metadata !"pointer", metadata !0} -!7 = metadata !{metadata !"double", metadata !0} -!8 = metadata !{metadata !"char", metadata !9} -!9 = metadata !{metadata !"root", null} +!3 = !{!"pointer", !8} +!4 = !{!8, !8, i64 0} +!5 = !{!9, !9, i64 0} +!6 = !{!"pointer", !0} +!7 = !{!"double", !0} +!8 = !{!"char", !9} +!9 = !{!"root", null} diff --git a/test/Analysis/TypeBasedAliasAnalysis/memcpyopt.ll b/test/Analysis/TypeBasedAliasAnalysis/memcpyopt.ll index cdf72811ce5f..9fc9e42fc6cb 100644 --- a/test/Analysis/TypeBasedAliasAnalysis/memcpyopt.ll +++ b/test/Analysis/TypeBasedAliasAnalysis/memcpyopt.ll @@ -18,10 +18,10 @@ define void @foo(i8* nocapture %p, i8* nocapture %q, i8* nocapture %s) nounwind declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind -; CHECK: [[TAGA]] = metadata !{metadata [[TYPEA:!.*]], metadata [[TYPEA]], i64 0} -; CHECK: [[TYPEA]] = metadata !{metadata !"A", metadata !{{.*}}} -!0 = metadata !{metadata !"tbaa root", null} -!1 = metadata !{metadata !3, metadata !3, i64 0} -!2 = metadata !{metadata !4, metadata !4, i64 0} -!3 = metadata !{metadata !"A", metadata !0} -!4 = metadata !{metadata !"B", metadata !0} +; CHECK: [[TAGA]] = !{[[TYPEA:!.*]], [[TYPEA]], i64 0} +; CHECK: [[TYPEA]] = !{!"A", !{{.*}}} +!0 = !{!"tbaa root", null} +!1 = !{!3, !3, i64 0} +!2 = !{!4, !4, i64 0} +!3 = !{!"A", !0} +!4 = !{!"B", !0} diff --git a/test/Analysis/TypeBasedAliasAnalysis/placement-tbaa.ll b/test/Analysis/TypeBasedAliasAnalysis/placement-tbaa.ll index 609e87c2313f..fd05dbea7cba 100644 --- a/test/Analysis/TypeBasedAliasAnalysis/placement-tbaa.ll +++ b/test/Analysis/TypeBasedAliasAnalysis/placement-tbaa.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -tbaa -basicaa -aa-eval -evaluate-tbaa -print-no-aliases -print-may-aliases -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -tbaa -basicaa -aa-eval -evaluate-aa-metadata -print-no-aliases -print-may-aliases -disable-output 2>&1 | FileCheck %s ; Generated with "clang -cc1 -disable-llvm-optzns -O1 -emit-llvm" ; #include <new> @@ -97,14 +97,14 @@ declare noalias i8* @_Znwm(i64) attributes #0 = { nounwind } -!0 = metadata !{metadata !1, metadata !1, i64 0} -!1 = metadata !{metadata !"int", metadata !2, i64 0} -!2 = metadata !{metadata !"omnipotent char", metadata !3, i64 0} -!3 = metadata !{metadata !"Simple C/C++ TBAA"} -!4 = metadata !{metadata !5, metadata !5, i64 0} -!5 = metadata !{metadata !"any pointer", metadata !2, i64 0} -!6 = metadata !{metadata !7, metadata !8, i64 0} -!7 = metadata !{metadata !"_ZTS3Foo", metadata !8, i64 0} -!8 = metadata !{metadata !"long", metadata !2, i64 0} -!9 = metadata !{metadata !10, metadata !5, i64 0} -!10 = metadata !{metadata !"_ZTS3Bar", metadata !5, i64 0} +!0 = !{!1, !1, i64 0} +!1 = !{!"int", !2, i64 0} +!2 = !{!"omnipotent char", !3, i64 0} +!3 = !{!"Simple C/C++ TBAA"} +!4 = !{!5, !5, i64 0} +!5 = !{!"any pointer", !2, i64 0} +!6 = !{!7, !8, i64 0} +!7 = !{!"_ZTS3Foo", !8, i64 0} +!8 = !{!"long", !2, i64 0} +!9 = !{!10, !5, i64 0} +!10 = !{!"_ZTS3Bar", !5, i64 0} diff --git a/test/Analysis/TypeBasedAliasAnalysis/precedence.ll b/test/Analysis/TypeBasedAliasAnalysis/precedence.ll index b219ef19284e..0b697b2e8869 100644 --- a/test/Analysis/TypeBasedAliasAnalysis/precedence.ll +++ b/test/Analysis/TypeBasedAliasAnalysis/precedence.ll @@ -39,12 +39,12 @@ entry: ret i64 %tmp3 } -!0 = metadata !{metadata !2, metadata !2, i64 0} -!1 = metadata !{metadata !"simple"} -!2 = metadata !{metadata !"int", metadata !1} -!3 = metadata !{metadata !6, metadata !6, i64 0} -!4 = metadata !{metadata !7, metadata !7, i64 0} -!5 = metadata !{metadata !8, metadata !8, i64 0} -!6 = metadata !{metadata !"float", metadata !1} -!7 = metadata !{metadata !"long", metadata !1} -!8 = metadata !{metadata !"small", metadata !1} +!0 = !{!2, !2, i64 0} +!1 = !{!"simple"} +!2 = !{!"int", !1} +!3 = !{!6, !6, i64 0} +!4 = !{!7, !7, i64 0} +!5 = !{!8, !8, i64 0} +!6 = !{!"float", !1} +!7 = !{!"long", !1} +!8 = !{!"small", !1} diff --git a/test/Analysis/TypeBasedAliasAnalysis/sink.ll b/test/Analysis/TypeBasedAliasAnalysis/sink.ll index 726da6ce1e81..1a124b86083b 100644 --- a/test/Analysis/TypeBasedAliasAnalysis/sink.ll +++ b/test/Analysis/TypeBasedAliasAnalysis/sink.ll @@ -15,10 +15,10 @@ b: ret void } -; CHECK: [[TAGA]] = metadata !{metadata [[TYPEA:!.*]], metadata [[TYPEA]], i64 0} -; CHECK: [[TYPEA]] = metadata !{metadata !"A", metadata !{{.*}}} -!0 = metadata !{metadata !3, metadata !3, i64 0} -!1 = metadata !{metadata !4, metadata !4, i64 0} -!2 = metadata !{metadata !"test"} -!3 = metadata !{metadata !"A", metadata !2} -!4 = metadata !{metadata !"B", metadata !2} +; CHECK: [[TAGA]] = !{[[TYPEA:!.*]], [[TYPEA]], i64 0} +; CHECK: [[TYPEA]] = !{!"A", !{{.*}}} +!0 = !{!3, !3, i64 0} +!1 = !{!4, !4, i64 0} +!2 = !{!"test"} +!3 = !{!"A", !2} +!4 = !{!"B", !2} diff --git a/test/Analysis/TypeBasedAliasAnalysis/tbaa-path.ll b/test/Analysis/TypeBasedAliasAnalysis/tbaa-path.ll index e1c5d4526470..3c035af7c529 100644 --- a/test/Analysis/TypeBasedAliasAnalysis/tbaa-path.ll +++ b/test/Analysis/TypeBasedAliasAnalysis/tbaa-path.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -tbaa -basicaa -aa-eval -evaluate-tbaa -print-no-aliases -print-may-aliases -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -tbaa -basicaa -aa-eval -evaluate-aa-metadata -print-no-aliases -print-may-aliases -disable-output 2>&1 | FileCheck %s ; RUN: opt < %s -tbaa -basicaa -gvn -S | FileCheck %s --check-prefix=OPT ; Generated from clang/test/CodeGen/tbaa.cpp with "-O1 -struct-path-tbaa -disable-llvm-optzns". @@ -363,30 +363,30 @@ entry: attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } -!0 = metadata !{metadata !1, metadata !1, i64 0} -!1 = metadata !{metadata !"any pointer", metadata !2} -!2 = metadata !{metadata !"omnipotent char", metadata !3} -!3 = metadata !{metadata !"Simple C/C++ TBAA"} -!4 = metadata !{metadata !5, metadata !5, i64 0} -!5 = metadata !{metadata !"long long", metadata !2} -!6 = metadata !{metadata !7, metadata !7, i64 0} -!7 = metadata !{metadata !"int", metadata !2} -!8 = metadata !{metadata !9, metadata !7, i64 4} -!9 = metadata !{metadata !"_ZTS7StructA", metadata !10, i64 0, metadata !7, i64 4, metadata !10, i64 8, metadata !7, i64 12} -!10 = metadata !{metadata !"short", metadata !2} -!11 = metadata !{metadata !9, metadata !10, i64 0} -!12 = metadata !{metadata !13, metadata !7, i64 8} -!13 = metadata !{metadata !"_ZTS7StructB", metadata !10, i64 0, metadata !9, i64 4, metadata !7, i64 20} -!14 = metadata !{metadata !13, metadata !10, i64 4} -!15 = metadata !{metadata !13, metadata !7, i64 20} -!16 = metadata !{metadata !13, metadata !7, i64 16} -!17 = metadata !{metadata !18, metadata !7, i64 4} -!18 = metadata !{metadata !"_ZTS7StructS", metadata !10, i64 0, metadata !7, i64 4} -!19 = metadata !{metadata !18, metadata !10, i64 0} -!20 = metadata !{metadata !21, metadata !7, i64 4} -!21 = metadata !{metadata !"_ZTS8StructS2", metadata !10, i64 0, metadata !7, i64 4} -!22 = metadata !{metadata !21, metadata !10, i64 0} -!23 = metadata !{metadata !24, metadata !7, i64 12} -!24 = metadata !{metadata !"_ZTS7StructC", metadata !10, i64 0, metadata !13, i64 4, metadata !7, i64 28} -!25 = metadata !{metadata !26, metadata !7, i64 12} -!26 = metadata !{metadata !"_ZTS7StructD", metadata !10, i64 0, metadata !13, i64 4, metadata !7, i64 28, metadata !2, i64 32} +!0 = !{!1, !1, i64 0} +!1 = !{!"any pointer", !2} +!2 = !{!"omnipotent char", !3} +!3 = !{!"Simple C/C++ TBAA"} +!4 = !{!5, !5, i64 0} +!5 = !{!"long long", !2} +!6 = !{!7, !7, i64 0} +!7 = !{!"int", !2} +!8 = !{!9, !7, i64 4} +!9 = !{!"_ZTS7StructA", !10, i64 0, !7, i64 4, !10, i64 8, !7, i64 12} +!10 = !{!"short", !2} +!11 = !{!9, !10, i64 0} +!12 = !{!13, !7, i64 8} +!13 = !{!"_ZTS7StructB", !10, i64 0, !9, i64 4, !7, i64 20} +!14 = !{!13, !10, i64 4} +!15 = !{!13, !7, i64 20} +!16 = !{!13, !7, i64 16} +!17 = !{!18, !7, i64 4} +!18 = !{!"_ZTS7StructS", !10, i64 0, !7, i64 4} +!19 = !{!18, !10, i64 0} +!20 = !{!21, !7, i64 4} +!21 = !{!"_ZTS8StructS2", !10, i64 0, !7, i64 4} +!22 = !{!21, !10, i64 0} +!23 = !{!24, !7, i64 12} +!24 = !{!"_ZTS7StructC", !10, i64 0, !13, i64 4, !7, i64 28} +!25 = !{!26, !7, i64 12} +!26 = !{!"_ZTS7StructD", !10, i64 0, !13, i64 4, !7, i64 28, !2, i64 32} |