From e6676a1382ff4c8f6c520486323430745948481d Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 16 Dec 2022 14:14:51 +0100 Subject: [PATCH] [SCEV] Convert tests to opaque pointers (NFC) --- .../ScalarEvolution/different-loops-recs.ll | 18 +- .../Analysis/ScalarEvolution/flags-from-poison.ll | 455 ++++++++++----------- .../Analysis/ScalarEvolution/max-mulops-inline.ll | 6 +- .../ScalarEvolution/overflow-intrinsics.ll | 60 +-- llvm/test/Analysis/ScalarEvolution/scev-aa.ll | 152 ++++--- .../ScalarEvolution/scev-expander-reuse-gep.ll | 20 +- llvm/test/Analysis/ScalarEvolution/sext-mul.ll | 44 +- 7 files changed, 373 insertions(+), 382 deletions(-) diff --git a/llvm/test/Analysis/ScalarEvolution/different-loops-recs.ll b/llvm/test/Analysis/ScalarEvolution/different-loops-recs.ll index 54a3f97..5e996c8 100644 --- a/llvm/test/Analysis/ScalarEvolution/different-loops-recs.ll +++ b/llvm/test/Analysis/ScalarEvolution/different-loops-recs.ll @@ -143,7 +143,7 @@ exit: ; Check that we can correctly evaluate a sum of phis+variants from two different ; loops in any order. -define void @test_02(i32 %a, i32 %b, i32* %p) { +define void @test_02(i32 %a, i32 %b, ptr %p) { ; CHECK-LABEL: Classifying expressions for: @test_02 ; CHECK: %sum1 = add i32 %phi1, %phi2 @@ -185,7 +185,7 @@ loop1: %phi1.inc = add i32 %phi1, 1 %phi2.inc = add i32 %phi2, 2 %phi3.inc = add i32 %phi3, 3 - %v1 = load i32, i32* %p + %v1 = load i32, ptr %p %sum1 = add i32 %phi1, %phi2 %sum2 = add i32 %sum1, %phi3 %is1 = add i32 %sum2, %v1 @@ -199,7 +199,7 @@ loop2: %phi4.inc = add i32 %phi4, 1 %phi5.inc = add i32 %phi5, 2 %phi6.inc = add i32 %phi6, 3 - %v2 = load i32, i32* %p + %v2 = load i32, ptr %p %sum3 = add i32 %phi4, %phi5 %sum4 = add i32 %sum3, %phi6 %is2 = add i32 %sum4, %v2 @@ -223,10 +223,10 @@ exit: ; incorrect order. It also shows that we cannot safely fold v1 (SCEVUnknown) ; because we cannot prove for sure that it doesn't use Phis of loop 2. -define void @test_03(i32 %a, i32 %b, i32 %c, i32* %p) { +define void @test_03(i32 %a, i32 %b, i32 %c, ptr %p) { ; CHECK-LABEL: Classifying expressions for: @test_03 -; CHECK: %v1 = load i32, i32* %p +; CHECK: %v1 = load i32, ptr %p ; CHECK-NEXT: --> %v1 ; CHECK: %s1 = add i32 %phi1, %v1 ; CHECK-NEXT: --> ({%a,+,1}<%loop1> + %v1) @@ -247,7 +247,7 @@ loop1: loop2: %phi2 = phi i32 [ %a, %loop1 ], [ %phi2.inc, %loop2 ] %phi2.inc = add i32 %phi2, 2 - %v1 = load i32, i32* %p + %v1 = load i32, ptr %p %s1 = add i32 %phi1, %v1 %s2 = add i32 %s1, %b %s3 = add i32 %s2, %phi2 @@ -301,7 +301,7 @@ bb5: loop2: %tmp7 = phi i64 [ %tmp15, %loop2 ], [ 2, %loop1 ] - %tmp8 = load i8, i8 addrspace(1)* undef, align 1 + %tmp8 = load i8, ptr addrspace(1) undef, align 1 %tmp9 = sext i8 %tmp8 to i64 %tmp10 = sub i64 %tmp9, %tmp7 %tmp11 = add i64 %tmp10, undef @@ -331,8 +331,8 @@ entry: br label %bb3 bb: ; preds = %bb3 - %tmp = getelementptr [1000 x i32], [1000 x i32]* @A, i32 0, i32 %i.0 ; [#uses=1] - store i32 123, i32* %tmp + %tmp = getelementptr [1000 x i32], ptr @A, i32 0, i32 %i.0 ; [#uses=1] + store i32 123, ptr %tmp %tmp2 = add i32 %i.0, 1 ; [#uses=1] br label %bb3 diff --git a/llvm/test/Analysis/ScalarEvolution/flags-from-poison.ll b/llvm/test/Analysis/ScalarEvolution/flags-from-poison.ll index 536c389..c07f4c0 100644 --- a/llvm/test/Analysis/ScalarEvolution/flags-from-poison.ll +++ b/llvm/test/Analysis/ScalarEvolution/flags-from-poison.ll @@ -15,7 +15,7 @@ define void @foo() { ; Example where an add should get the nsw flag, so that a sext can be ; distributed over the add. -define void @test-add-nsw(float* %input, i32 %offset, i32 %numIterations) { +define void @test-add-nsw(ptr %input, i32 %offset, i32 %numIterations) { ; CHECK-LABEL: 'test-add-nsw' ; CHECK-NEXT: Classifying expressions for: @test-add-nsw ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ 0, %entry ] @@ -24,7 +24,7 @@ define void @test-add-nsw(float* %input, i32 %offset, i32 %numIterations) { ; CHECK-NEXT: --> {%offset,+,1}<%loop> U: full-set S: full-set Exits: (-1 + %offset + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index64 = sext i32 %index32 to i64 ; CHECK-NEXT: --> {(sext i32 %offset to i64),+,1}<%loop> U: [-2147483648,6442450943) S: [-2147483648,6442450943) Exits: ((zext i32 (-1 + %numIterations) to i64) + (sext i32 %offset to i64)) LoopDispositions: { %loop: Computable } -; CHECK-NEXT: %ptr = getelementptr inbounds float, float* %input, i64 %index64 +; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i64 %index64 ; CHECK-NEXT: --> {((4 * (sext i32 %offset to i64)) + %input),+,4}<%loop> U: full-set S: full-set Exits: ((4 * (zext i32 (-1 + %numIterations) to i64)) + (4 * (sext i32 %offset to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 ; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,0) S: [1,0) Exits: %numIterations LoopDispositions: { %loop: Computable } @@ -45,9 +45,9 @@ loop: %index64 = sext i32 %index32 to i64 - %ptr = getelementptr inbounds float, float* %input, i64 %index64 + %ptr = getelementptr inbounds float, ptr %input, i64 %index64 %nexti = add nsw i32 %i, 1 - %f = load float, float* %ptr, align 4 + %f = load float, ptr %ptr, align 4 call void @foo() %exitcond = icmp eq i32 %nexti, %numIterations br i1 %exitcond, label %exit, label %loop @@ -56,14 +56,14 @@ exit: } ; Example where an add should get the nuw flag. -define void @test-add-nuw(float* %input, i32 %offset, i32 %numIterations) { +define void @test-add-nuw(ptr %input, i32 %offset, i32 %numIterations) { ; CHECK-LABEL: 'test-add-nuw' ; CHECK-NEXT: Classifying expressions for: @test-add-nuw ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ 0, %entry ] ; CHECK-NEXT: --> {0,+,1}<%loop> U: full-set S: full-set Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index32 = add nuw i32 %i, %offset ; CHECK-NEXT: --> {%offset,+,1}<%loop> U: full-set S: full-set Exits: (-1 + %offset + %numIterations) LoopDispositions: { %loop: Computable } -; CHECK-NEXT: %ptr = getelementptr inbounds float, float* %input, i32 %index32 +; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i32 %index32 ; CHECK-NEXT: --> ((4 * (sext i32 {%offset,+,1}<%loop> to i64)) + %input) U: full-set S: full-set Exits: ((4 * (sext i32 (-1 + %offset + %numIterations) to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nuw i32 %i, 1 ; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,0) S: [1,0) Exits: %numIterations LoopDispositions: { %loop: Computable } @@ -82,9 +82,9 @@ loop: %index32 = add nuw i32 %i, %offset - %ptr = getelementptr inbounds float, float* %input, i32 %index32 + %ptr = getelementptr inbounds float, ptr %input, i32 %index32 %nexti = add nuw i32 %i, 1 - %f = load float, float* %ptr, align 4 + %f = load float, ptr %ptr, align 4 %exitcond = icmp eq i32 %nexti, %numIterations br i1 %exitcond, label %exit, label %loop @@ -94,10 +94,10 @@ exit: ; Case where we're checking to see if add flags are valid in defining scope ; and all operands (other than addrec) are invariant -define void @test-add-scope-invariant(i32* %input, i32 %needle) { +define void @test-add-scope-invariant(ptr %input, i32 %needle) { ; CHECK-LABEL: 'test-add-scope-invariant' ; CHECK-NEXT: Classifying expressions for: @test-add-scope-invariant -; CHECK-NEXT: %offset = load i32, i32* %input, align 4 +; CHECK-NEXT: %offset = load i32, ptr %input, align 4 ; CHECK-NEXT: --> %offset U: full-set S: full-set ; CHECK-NEXT: %i = phi i32 [ %i.next, %loop ], [ 0, %entry ] ; CHECK-NEXT: --> {0,+,1}<%loop> U: full-set S: full-set Exits: (-1 + (-1 * %offset) + %needle) LoopDispositions: { %loop: Computable } @@ -105,7 +105,7 @@ define void @test-add-scope-invariant(i32* %input, i32 %needle) { ; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,0) S: [1,0) Exits: ((-1 * %offset) + %needle) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %of_interest = add nuw nsw i32 %i.next, %offset ; CHECK-NEXT: --> {(1 + %offset),+,1}<%loop> U: [1,0) S: [1,0) Exits: %needle LoopDispositions: { %loop: Computable } -; CHECK-NEXT: %gep2 = getelementptr i32, i32* %input, i32 %of_interest +; CHECK-NEXT: %gep2 = getelementptr i32, ptr %input, i32 %of_interest ; CHECK-NEXT: --> ((4 * (sext i32 {(1 + %offset),+,1}<%loop> to i64)) + %input) U: full-set S: full-set Exits: ((4 * (sext i32 %needle to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test-add-scope-invariant ; CHECK-NEXT: Loop %loop: backedge-taken count is (-1 + (-1 * %offset) + %needle) @@ -116,14 +116,14 @@ define void @test-add-scope-invariant(i32* %input, i32 %needle) { ; CHECK: Loop %loop: Trip multiple is 1 ; entry: - %offset = load i32, i32* %input + %offset = load i32, ptr %input br label %loop loop: %i = phi i32 [ %i.next, %loop ], [ 0, %entry ] %i.next = add nuw i32 %i, 1 %of_interest = add nuw nsw i32 %i.next, %offset - %gep2 = getelementptr i32, i32* %input, i32 %of_interest - store i32 0, i32* %gep2 + %gep2 = getelementptr i32, ptr %input, i32 %of_interest + store i32 0, ptr %gep2 %exitcond = icmp eq i32 %of_interest, %needle br i1 %exitcond, label %exit, label %loop @@ -133,20 +133,20 @@ exit: ; Case where we're checking to see if add flags are valid in defining scope ; and other operands are *not* invariant. -define void @test-add-scope-bound(i32* %input, i32 %needle) { +define void @test-add-scope-bound(ptr %input, i32 %needle) { ; CHECK-LABEL: 'test-add-scope-bound' ; CHECK-NEXT: Classifying expressions for: @test-add-scope-bound ; CHECK-NEXT: %i = phi i32 [ %i.next, %loop ], [ 0, %entry ] ; CHECK-NEXT: --> {0,+,1}<%loop> U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Computable } -; CHECK-NEXT: %gep = getelementptr i32, i32* %input, i32 %i +; CHECK-NEXT: %gep = getelementptr i32, ptr %input, i32 %i ; CHECK-NEXT: --> ((4 * (sext i32 {0,+,1}<%loop> to i64)) + %input) U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Computable } -; CHECK-NEXT: %offset = load i32, i32* %gep, align 4 +; CHECK-NEXT: %offset = load i32, ptr %gep, align 4 ; CHECK-NEXT: --> %offset U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Variant } ; CHECK-NEXT: %i.next = add nuw i32 %i, 1 ; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,0) S: [1,0) Exits: <> LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %of_interest = add nuw nsw i32 %i.next, %offset ; CHECK-NEXT: --> ({1,+,1}<%loop> + %offset) U: [1,0) S: [1,0) Exits: <> LoopDispositions: { %loop: Variant } -; CHECK-NEXT: %gep2 = getelementptr i32, i32* %input, i32 %of_interest +; CHECK-NEXT: %gep2 = getelementptr i32, ptr %input, i32 %of_interest ; CHECK-NEXT: --> ((4 * ((sext i32 {1,+,1}<%loop> to i64) + (sext i32 %offset to i64))) + %input) U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Variant } ; CHECK-NEXT: Determining loop execution counts for: @test-add-scope-bound ; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count. @@ -158,12 +158,12 @@ entry: br label %loop loop: %i = phi i32 [ %i.next, %loop ], [ 0, %entry ] - %gep = getelementptr i32, i32* %input, i32 %i - %offset = load i32, i32* %gep + %gep = getelementptr i32, ptr %input, i32 %i + %offset = load i32, ptr %gep %i.next = add nuw i32 %i, 1 %of_interest = add nuw nsw i32 %i.next, %offset - %gep2 = getelementptr i32, i32* %input, i32 %of_interest - store i32 0, i32* %gep2 + %gep2 = getelementptr i32, ptr %input, i32 %of_interest + store i32 0, ptr %gep2 %exitcond = icmp eq i32 %of_interest, %needle br i1 %exitcond, label %exit, label %loop @@ -171,16 +171,16 @@ exit: ret void } -define void @test-add-scope-bound-unkn-preheader(i32* %input, i32 %needle) { +define void @test-add-scope-bound-unkn-preheader(ptr %input, i32 %needle) { ; CHECK-LABEL: 'test-add-scope-bound-unkn-preheader' ; CHECK-NEXT: Classifying expressions for: @test-add-scope-bound-unkn-preheader -; CHECK-NEXT: %offset = load i32, i32* %input, align 4 +; CHECK-NEXT: %offset = load i32, ptr %input, align 4 ; CHECK-NEXT: --> %offset U: full-set S: full-set ; CHECK-NEXT: %i = phi i32 [ %i.next, %loop ], [ 0, %entry ] ; CHECK-NEXT: --> {0,+,%offset}<%loop> U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %i.next = add nuw i32 %i, %offset ; CHECK-NEXT: --> {%offset,+,%offset}<%loop> U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Computable } -; CHECK-NEXT: %gep2 = getelementptr i32, i32* %input, i32 %i.next +; CHECK-NEXT: %gep2 = getelementptr i32, ptr %input, i32 %i.next ; CHECK-NEXT: --> ((4 * (sext i32 {%offset,+,%offset}<%loop> to i64)) + %input) U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test-add-scope-bound-unkn-preheader ; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count. @@ -189,13 +189,13 @@ define void @test-add-scope-bound-unkn-preheader(i32* %input, i32 %needle) { ; CHECK-NEXT: Loop %loop: Unpredictable predicated backedge-taken count. ; entry: - %offset = load i32, i32* %input + %offset = load i32, ptr %input br label %loop loop: %i = phi i32 [ %i.next, %loop ], [ 0, %entry ] %i.next = add nuw i32 %i, %offset - %gep2 = getelementptr i32, i32* %input, i32 %i.next - store i32 0, i32* %gep2 + %gep2 = getelementptr i32, ptr %input, i32 %i.next + store i32 0, ptr %gep2 %exitcond = icmp eq i32 %i.next, %needle br i1 %exitcond, label %exit, label %loop @@ -203,16 +203,16 @@ exit: ret void } -define void @test-add-scope-bound-unkn-preheader-neg1(i32* %input, i32 %needle) { +define void @test-add-scope-bound-unkn-preheader-neg1(ptr %input, i32 %needle) { ; CHECK-LABEL: 'test-add-scope-bound-unkn-preheader-neg1' ; CHECK-NEXT: Classifying expressions for: @test-add-scope-bound-unkn-preheader-neg1 -; CHECK-NEXT: %offset = load i32, i32* %input, align 4 +; CHECK-NEXT: %offset = load i32, ptr %input, align 4 ; CHECK-NEXT: --> %offset U: full-set S: full-set ; CHECK-NEXT: %i = phi i32 [ %i.next, %loop ], [ 0, %entry ] ; CHECK-NEXT: --> {0,+,%offset}<%loop> U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %i.next = add nuw i32 %i, %offset ; CHECK-NEXT: --> {%offset,+,%offset}<%loop> U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Computable } -; CHECK-NEXT: %gep2 = getelementptr i32, i32* %input, i32 %i.next +; CHECK-NEXT: %gep2 = getelementptr i32, ptr %input, i32 %i.next ; CHECK-NEXT: --> ((4 * (sext i32 {%offset,+,%offset}<%loop> to i64)) + %input) U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test-add-scope-bound-unkn-preheader-neg1 ; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count. @@ -221,14 +221,14 @@ define void @test-add-scope-bound-unkn-preheader-neg1(i32* %input, i32 %needle) ; CHECK-NEXT: Loop %loop: Unpredictable predicated backedge-taken count. ; entry: - %offset = load i32, i32* %input + %offset = load i32, ptr %input call void @foo() br label %loop loop: %i = phi i32 [ %i.next, %loop ], [ 0, %entry ] %i.next = add nuw i32 %i, %offset - %gep2 = getelementptr i32, i32* %input, i32 %i.next - store i32 0, i32* %gep2 + %gep2 = getelementptr i32, ptr %input, i32 %i.next + store i32 0, ptr %gep2 %exitcond = icmp eq i32 %i.next, %needle br i1 %exitcond, label %exit, label %loop @@ -236,16 +236,16 @@ exit: ret void } -define void @test-add-scope-bound-unkn-preheader-neg2(i32* %input, i32 %needle) { +define void @test-add-scope-bound-unkn-preheader-neg2(ptr %input, i32 %needle) { ; CHECK-LABEL: 'test-add-scope-bound-unkn-preheader-neg2' ; CHECK-NEXT: Classifying expressions for: @test-add-scope-bound-unkn-preheader-neg2 -; CHECK-NEXT: %offset = load i32, i32* %input, align 4 +; CHECK-NEXT: %offset = load i32, ptr %input, align 4 ; CHECK-NEXT: --> %offset U: full-set S: full-set ; CHECK-NEXT: %i = phi i32 [ %i.next, %loop ], [ 0, %entry ] ; CHECK-NEXT: --> {0,+,%offset}<%loop> U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %i.next = add nuw i32 %i, %offset ; CHECK-NEXT: --> {%offset,+,%offset}<%loop> U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Computable } -; CHECK-NEXT: %gep2 = getelementptr i32, i32* %input, i32 %i.next +; CHECK-NEXT: %gep2 = getelementptr i32, ptr %input, i32 %i.next ; CHECK-NEXT: --> ((4 * (sext i32 {%offset,+,%offset}<%loop> to i64)) + %input) U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Computable } ; CHECK-NEXT: Determining loop execution counts for: @test-add-scope-bound-unkn-preheader-neg2 ; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count. @@ -254,14 +254,14 @@ define void @test-add-scope-bound-unkn-preheader-neg2(i32* %input, i32 %needle) ; CHECK-NEXT: Loop %loop: Unpredictable predicated backedge-taken count. ; entry: - %offset = load i32, i32* %input + %offset = load i32, ptr %input br label %loop loop: %i = phi i32 [ %i.next, %loop ], [ 0, %entry ] call void @foo() %i.next = add nuw i32 %i, %offset - %gep2 = getelementptr i32, i32* %input, i32 %i.next - store i32 0, i32* %gep2 + %gep2 = getelementptr i32, ptr %input, i32 %i.next + store i32 0, ptr %gep2 %exitcond = icmp eq i32 %i.next, %needle br i1 %exitcond, label %exit, label %loop @@ -270,18 +270,18 @@ exit: } -define void @test-add-scope-bound-unkn-header(i32* %input, i32 %needle) { +define void @test-add-scope-bound-unkn-header(ptr %input, i32 %needle) { ; CHECK-LABEL: 'test-add-scope-bound-unkn-header' ; CHECK-NEXT: Classifying expressions for: @test-add-scope-bound-unkn-header ; CHECK-NEXT: %i = phi i32 [ %i.next, %loop ], [ 0, %entry ] ; CHECK-NEXT: --> %i U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Variant } -; CHECK-NEXT: %gep = getelementptr i32, i32* %input, i32 %i +; CHECK-NEXT: %gep = getelementptr i32, ptr %input, i32 %i ; CHECK-NEXT: --> ((4 * (sext i32 %i to i64)) + %input) U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Variant } -; CHECK-NEXT: %offset = load i32, i32* %gep, align 4 +; CHECK-NEXT: %offset = load i32, ptr %gep, align 4 ; CHECK-NEXT: --> %offset U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Variant } ; CHECK-NEXT: %i.next = add nuw i32 %i, %offset ; CHECK-NEXT: --> (%offset + %i) U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Variant } -; CHECK-NEXT: %gep2 = getelementptr i32, i32* %input, i32 %i.next +; CHECK-NEXT: %gep2 = getelementptr i32, ptr %input, i32 %i.next ; CHECK-NEXT: --> ((4 * (sext i32 (%offset + %i) to i64)) + %input) U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Variant } ; CHECK-NEXT: Determining loop execution counts for: @test-add-scope-bound-unkn-header ; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count. @@ -293,11 +293,11 @@ entry: br label %loop loop: %i = phi i32 [ %i.next, %loop ], [ 0, %entry ] - %gep = getelementptr i32, i32* %input, i32 %i - %offset = load i32, i32* %gep + %gep = getelementptr i32, ptr %input, i32 %i + %offset = load i32, ptr %gep %i.next = add nuw i32 %i, %offset - %gep2 = getelementptr i32, i32* %input, i32 %i.next - store i32 0, i32* %gep2 + %gep2 = getelementptr i32, ptr %input, i32 %i.next + store i32 0, ptr %gep2 %exitcond = icmp eq i32 %i.next, %needle br i1 %exitcond, label %exit, label %loop @@ -305,18 +305,18 @@ exit: ret void } -define void @test-add-scope-bound-unkn-header2(i32* %input, i32 %needle) { +define void @test-add-scope-bound-unkn-header2(ptr %input, i32 %needle) { ; CHECK-LABEL: 'test-add-scope-bound-unkn-header2' ; CHECK-NEXT: Classifying expressions for: @test-add-scope-bound-unkn-header2 ; CHECK-NEXT: %i = phi i32 [ %i.next, %loop ], [ 0, %entry ] ; CHECK-NEXT: --> %i U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Variant } -; CHECK-NEXT: %gep = getelementptr i32, i32* %input, i32 %i +; CHECK-NEXT: %gep = getelementptr i32, ptr %input, i32 %i ; CHECK-NEXT: --> ((4 * (sext i32 %i to i64)) + %input) U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Variant } -; CHECK-NEXT: %offset = load i32, i32* %gep, align 4 +; CHECK-NEXT: %offset = load i32, ptr %gep, align 4 ; CHECK-NEXT: --> %offset U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Variant } ; CHECK-NEXT: %i.next = add nuw i32 %i, %offset ; CHECK-NEXT: --> (%offset + %i) U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Variant } -; CHECK-NEXT: %gep2 = getelementptr i32, i32* %input, i32 %i.next +; CHECK-NEXT: %gep2 = getelementptr i32, ptr %input, i32 %i.next ; CHECK-NEXT: --> ((4 * (sext i32 (%offset + %i) to i64)) + %input) U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Variant } ; CHECK-NEXT: Determining loop execution counts for: @test-add-scope-bound-unkn-header2 ; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count. @@ -329,11 +329,11 @@ entry: loop: %i = phi i32 [ %i.next, %loop ], [ 0, %entry ] call void @foo() - %gep = getelementptr i32, i32* %input, i32 %i - %offset = load i32, i32* %gep + %gep = getelementptr i32, ptr %input, i32 %i + %offset = load i32, ptr %gep %i.next = add nuw i32 %i, %offset - %gep2 = getelementptr i32, i32* %input, i32 %i.next - store i32 0, i32* %gep2 + %gep2 = getelementptr i32, ptr %input, i32 %i.next + store i32 0, ptr %gep2 %exitcond = icmp eq i32 %i.next, %needle br i1 %exitcond, label %exit, label %loop @@ -341,18 +341,18 @@ exit: ret void } -define void @test-add-scope-bound-unkn-header-neg(i32* %input, i32 %needle) { +define void @test-add-scope-bound-unkn-header-neg(ptr %input, i32 %needle) { ; CHECK-LABEL: 'test-add-scope-bound-unkn-header-neg' ; CHECK-NEXT: Classifying expressions for: @test-add-scope-bound-unkn-header-neg ; CHECK-NEXT: %i = phi i32 [ %i.next, %loop ], [ 0, %entry ] ; CHECK-NEXT: --> %i U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Variant } -; CHECK-NEXT: %gep = getelementptr i32, i32* %input, i32 %i +; CHECK-NEXT: %gep = getelementptr i32, ptr %input, i32 %i ; CHECK-NEXT: --> ((4 * (sext i32 %i to i64)) + %input) U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Variant } -; CHECK-NEXT: %offset = load i32, i32* %gep, align 4 +; CHECK-NEXT: %offset = load i32, ptr %gep, align 4 ; CHECK-NEXT: --> %offset U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Variant } ; CHECK-NEXT: %i.next = add nuw i32 %i, %offset ; CHECK-NEXT: --> (%offset + %i) U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Variant } -; CHECK-NEXT: %gep2 = getelementptr i32, i32* %input, i32 %i.next +; CHECK-NEXT: %gep2 = getelementptr i32, ptr %input, i32 %i.next ; CHECK-NEXT: --> ((4 * (sext i32 (%offset + %i) to i64)) + %input) U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Variant } ; CHECK-NEXT: Determining loop execution counts for: @test-add-scope-bound-unkn-header-neg ; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count. @@ -364,12 +364,12 @@ entry: br label %loop loop: %i = phi i32 [ %i.next, %loop ], [ 0, %entry ] - %gep = getelementptr i32, i32* %input, i32 %i - %offset = load i32, i32* %gep + %gep = getelementptr i32, ptr %input, i32 %i + %offset = load i32, ptr %gep call void @foo() %i.next = add nuw i32 %i, %offset - %gep2 = getelementptr i32, i32* %input, i32 %i.next - store i32 0, i32* %gep2 + %gep2 = getelementptr i32, ptr %input, i32 %i.next + store i32 0, ptr %gep2 %exitcond = icmp eq i32 %i.next, %needle br i1 %exitcond, label %exit, label %loop @@ -377,7 +377,7 @@ exit: ret void } -define void @test-add-nuw-from-icmp(float* %input, i32 %offset, +define void @test-add-nuw-from-icmp(ptr %input, i32 %offset, ; CHECK-LABEL: 'test-add-nuw-from-icmp' ; CHECK-NEXT: Classifying expressions for: @test-add-nuw-from-icmp ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ 0, %entry ] @@ -386,7 +386,7 @@ define void @test-add-nuw-from-icmp(float* %input, i32 %offset, ; CHECK-NEXT: --> {%offset,+,1}<%loop> U: full-set S: full-set Exits: (-1 + %offset + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %cmp.idx = sext i1 %cmp to i32 ; CHECK-NEXT: --> (sext i1 %cmp to i32) U: [-1,1) S: [-1,1) Exits: <> LoopDispositions: { %loop: Variant } -; CHECK-NEXT: %ptr = getelementptr inbounds float, float* %input, i32 %cmp.idx +; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i32 %cmp.idx ; CHECK-NEXT: --> ((4 * (sext i1 %cmp to i64)) + %input) U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Variant } ; CHECK-NEXT: %nexti = add nuw i32 %i, 1 ; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,0) S: [1,0) Exits: %numIterations LoopDispositions: { %loop: Computable } @@ -408,9 +408,9 @@ loop: %cmp = icmp sgt i32 %index32, 0 %cmp.idx = sext i1 %cmp to i32 - %ptr = getelementptr inbounds float, float* %input, i32 %cmp.idx + %ptr = getelementptr inbounds float, ptr %input, i32 %cmp.idx %nexti = add nuw i32 %i, 1 - %f = load float, float* %ptr, align 4 + %f = load float, ptr %ptr, align 4 %exitcond = icmp eq i32 %nexti, %numIterations br i1 %exitcond, label %exit, label %loop @@ -419,14 +419,14 @@ exit: } ; With no load to trigger UB from poison, we cannot infer nsw. -define void @test-add-no-load(float* %input, i32 %offset, i32 %numIterations) { +define void @test-add-no-load(ptr %input, i32 %offset, i32 %numIterations) { ; CHECK-LABEL: 'test-add-no-load' ; CHECK-NEXT: Classifying expressions for: @test-add-no-load ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ 0, %entry ] ; CHECK-NEXT: --> {0,+,1}<%loop> U: full-set S: full-set Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index32 = add nsw i32 %i, %offset ; CHECK-NEXT: --> {%offset,+,1}<%loop> U: full-set S: full-set Exits: (-1 + %offset + %numIterations) LoopDispositions: { %loop: Computable } -; CHECK-NEXT: %ptr = getelementptr inbounds float, float* %input, i32 %index32 +; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i32 %index32 ; CHECK-NEXT: --> ((4 * (sext i32 {%offset,+,1}<%loop> to i64)) + %input) U: full-set S: full-set Exits: ((4 * (sext i32 (-1 + %offset + %numIterations) to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nuw i32 %i, 1 ; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,0) S: [1,0) Exits: %numIterations LoopDispositions: { %loop: Computable } @@ -445,7 +445,7 @@ loop: %index32 = add nsw i32 %i, %offset - %ptr = getelementptr inbounds float, float* %input, i32 %index32 + %ptr = getelementptr inbounds float, ptr %input, i32 %index32 %nexti = add nuw i32 %i, 1 %exitcond = icmp eq i32 %nexti, %numIterations br i1 %exitcond, label %exit, label %loop @@ -457,14 +457,14 @@ exit: ; The current code is only supposed to look at the loop header, so ; it should not infer nsw in this case, as that would require looking ; outside the loop header. -define void @test-add-not-header(float* %input, i32 %offset, i32 %numIterations) { +define void @test-add-not-header(ptr %input, i32 %offset, i32 %numIterations) { ; CHECK-LABEL: 'test-add-not-header' ; CHECK-NEXT: Classifying expressions for: @test-add-not-header ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop2 ], [ 0, %entry ] ; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index32 = add nsw i32 %i, %offset ; CHECK-NEXT: --> {%offset,+,1}<%loop> U: full-set S: full-set Exits: (-1 + %offset + %numIterations) LoopDispositions: { %loop: Computable } -; CHECK-NEXT: %ptr = getelementptr inbounds float, float* %input, i32 %index32 +; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i32 %index32 ; CHECK-NEXT: --> ((4 * (sext i32 {%offset,+,1}<%loop> to i64)) + %input) U: full-set S: full-set Exits: ((4 * (sext i32 (-1 + %offset + %numIterations) to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 ; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,-2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } @@ -485,9 +485,9 @@ loop2: %index32 = add nsw i32 %i, %offset - %ptr = getelementptr inbounds float, float* %input, i32 %index32 + %ptr = getelementptr inbounds float, ptr %input, i32 %index32 %nexti = add nsw i32 %i, 1 - %f = load float, float* %ptr, align 4 + %f = load float, ptr %ptr, align 4 %exitcond = icmp eq i32 %nexti, %numIterations br i1 %exitcond, label %exit, label %loop exit: @@ -496,14 +496,14 @@ exit: ; Same thing as test-add-not-header, but in this case only the load ; instruction is outside the loop header. -define void @test-add-not-header2(float* %input, i32 %offset, i32 %numIterations) { +define void @test-add-not-header2(ptr %input, i32 %offset, i32 %numIterations) { ; CHECK-LABEL: 'test-add-not-header2' ; CHECK-NEXT: Classifying expressions for: @test-add-not-header2 ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop2 ], [ 0, %entry ] ; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index32 = add nsw i32 %i, %offset ; CHECK-NEXT: --> {%offset,+,1}<%loop> U: full-set S: full-set Exits: (-1 + %offset + %numIterations) LoopDispositions: { %loop: Computable } -; CHECK-NEXT: %ptr = getelementptr inbounds float, float* %input, i32 %index32 +; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i32 %index32 ; CHECK-NEXT: --> {((4 * (sext i32 %offset to i64)) + %input),+,4}<%loop> U: full-set S: full-set Exits: ((4 * (zext i32 (-1 + %numIterations) to i64)) + (4 * (sext i32 %offset to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 ; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,-2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } @@ -522,11 +522,11 @@ loop: %index32 = add nsw i32 %i, %offset - %ptr = getelementptr inbounds float, float* %input, i32 %index32 + %ptr = getelementptr inbounds float, ptr %input, i32 %index32 %nexti = add nsw i32 %i, 1 br label %loop2 loop2: - %f = load float, float* %ptr, align 4 + %f = load float, ptr %ptr, align 4 %exitcond = icmp eq i32 %nexti, %numIterations br i1 %exitcond, label %exit, label %loop exit: @@ -535,18 +535,18 @@ exit: ; Similar to test-add-not-header, but in this case the load ; instruction may not be executed. -define void @test-add-not-header3(float* %input, i32 %offset, i32 %numIterations, +define void @test-add-not-header3(ptr %input, i32 %offset, i32 %numIterations, ; CHECK-LABEL: 'test-add-not-header3' ; CHECK-NEXT: Classifying expressions for: @test-add-not-header3 ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop2 ], [ 0, %entry ] ; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: <> LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index32 = add nsw i32 %i, %offset ; CHECK-NEXT: --> {%offset,+,1}<%loop> U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Computable } -; CHECK-NEXT: %ptr = getelementptr inbounds float, float* %input, i32 %index32 +; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i32 %index32 ; CHECK-NEXT: --> ((4 * (sext i32 {%offset,+,1}<%loop> to i64)) + %input) U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 ; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,0) S: [1,0) Exits: <> LoopDispositions: { %loop: Computable } -; CHECK-NEXT: %cond = load volatile i1, i1* %cond_buf, align 1 +; CHECK-NEXT: %cond = load volatile i1, ptr %cond_buf, align 1 ; CHECK-NEXT: --> %cond U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Variant } ; CHECK-NEXT: Determining loop execution counts for: @test-add-not-header3 ; CHECK-NEXT: Loop %loop: Unpredictable backedge-taken count. @@ -558,7 +558,7 @@ define void @test-add-not-header3(float* %input, i32 %offset, i32 %numIterations ; CHECK-NEXT: symbolic max exit count for loop2: (-1 + %numIterations) ; CHECK-NEXT: Loop %loop: Unpredictable predicated backedge-taken count. ; - i1* %cond_buf) { + ptr %cond_buf) { entry: br label %loop loop: @@ -566,12 +566,12 @@ loop: %index32 = add nsw i32 %i, %offset - %ptr = getelementptr inbounds float, float* %input, i32 %index32 + %ptr = getelementptr inbounds float, ptr %input, i32 %index32 %nexti = add nsw i32 %i, 1 - %cond = load volatile i1, i1* %cond_buf + %cond = load volatile i1, ptr %cond_buf br i1 %cond, label %loop2, label %exit loop2: - %f = load float, float* %ptr, align 4 + %f = load float, ptr %ptr, align 4 %exitcond = icmp eq i32 %nexti, %numIterations br i1 %exitcond, label %exit, label %loop exit: @@ -580,14 +580,14 @@ exit: ; Same thing as test-add-not-header2, except we have a few extra ; blocks. -define void @test-add-not-header4(float* %input, i32 %offset, i32 %numIterations) { +define void @test-add-not-header4(ptr %input, i32 %offset, i32 %numIterations) { ; CHECK-LABEL: 'test-add-not-header4' ; CHECK-NEXT: Classifying expressions for: @test-add-not-header4 ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop2 ], [ 0, %entry ] ; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index32 = add nsw i32 %i, %offset ; CHECK-NEXT: --> {%offset,+,1}<%loop> U: full-set S: full-set Exits: (-1 + %offset + %numIterations) LoopDispositions: { %loop: Computable } -; CHECK-NEXT: %ptr = getelementptr inbounds float, float* %input, i32 %index32 +; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i32 %index32 ; CHECK-NEXT: --> {((4 * (sext i32 %offset to i64)) + %input),+,4}<%loop> U: full-set S: full-set Exits: ((4 * (zext i32 (-1 + %numIterations) to i64)) + (4 * (sext i32 %offset to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 ; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,-2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } @@ -606,7 +606,7 @@ loop: %index32 = add nsw i32 %i, %offset - %ptr = getelementptr inbounds float, float* %input, i32 %index32 + %ptr = getelementptr inbounds float, ptr %input, i32 %index32 %nexti = add nsw i32 %i, 1 br label %loop3 loop3: @@ -614,7 +614,7 @@ loop3: loop4: br label %loop2 loop2: - %f = load float, float* %ptr, align 4 + %f = load float, ptr %ptr, align 4 %exitcond = icmp eq i32 %nexti, %numIterations br i1 %exitcond, label %exit, label %loop exit: @@ -622,14 +622,14 @@ exit: } ; Demonstrate why we need a Visited set in llvm::programUndefinedIfPoison. -define void @test-add-not-header5(float* %input, i32 %offset) { +define void @test-add-not-header5(ptr %input, i32 %offset) { ; CHECK-LABEL: 'test-add-not-header5' ; CHECK-NEXT: Classifying expressions for: @test-add-not-header5 ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ 0, %entry ] ; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: <> LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index32 = add nsw i32 %i, %offset ; CHECK-NEXT: --> {%offset,+,1}<%loop> U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Computable } -; CHECK-NEXT: %ptr = getelementptr inbounds float, float* %input, i32 %index32 +; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i32 %index32 ; CHECK-NEXT: --> ((4 * (sext i32 {%offset,+,1}<%loop> to i64)) + %input) U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 ; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,0) S: [1,0) Exits: <> LoopDispositions: { %loop: Computable } @@ -646,7 +646,7 @@ loop: %index32 = add nsw i32 %i, %offset - %ptr = getelementptr inbounds float, float* %input, i32 %index32 + %ptr = getelementptr inbounds float, ptr %input, i32 %index32 %nexti = add nsw i32 %i, 1 br label %loop @@ -657,14 +657,14 @@ exit: ; The call instruction makes it not guaranteed that the add will be ; executed, since it could run forever or throw an exception, so we ; cannot assume that the UB is realized. -define void @test-add-call(float* %input, i32 %offset, i32 %numIterations) { +define void @test-add-call(ptr %input, i32 %offset, i32 %numIterations) { ; CHECK-LABEL: 'test-add-call' ; CHECK-NEXT: Classifying expressions for: @test-add-call ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ 0, %entry ] ; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index32 = add nsw i32 %i, %offset ; CHECK-NEXT: --> {%offset,+,1}<%loop> U: full-set S: full-set Exits: (-1 + %offset + %numIterations) LoopDispositions: { %loop: Computable } -; CHECK-NEXT: %ptr = getelementptr inbounds float, float* %input, i32 %index32 +; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i32 %index32 ; CHECK-NEXT: --> ((4 * (sext i32 {%offset,+,1}<%loop> to i64)) + %input) U: full-set S: full-set Exits: ((4 * (sext i32 (-1 + %offset + %numIterations) to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 ; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,0) S: [1,0) Exits: %numIterations LoopDispositions: { %loop: Computable } @@ -684,9 +684,9 @@ loop: call void @foo() %index32 = add nsw i32 %i, %offset - %ptr = getelementptr inbounds float, float* %input, i32 %index32 + %ptr = getelementptr inbounds float, ptr %input, i32 %index32 %nexti = add nsw i32 %i, 1 - %f = load float, float* %ptr, align 4 + %f = load float, ptr %ptr, align 4 %exitcond = icmp eq i32 %nexti, %numIterations br i1 %exitcond, label %exit, label %loop exit: @@ -695,14 +695,14 @@ exit: ; Same issue as test-add-call, but this time the call is between the ; producer of poison and the load that consumes it. -define void @test-add-call2(float* %input, i32 %offset, i32 %numIterations) { +define void @test-add-call2(ptr %input, i32 %offset, i32 %numIterations) { ; CHECK-LABEL: 'test-add-call2' ; CHECK-NEXT: Classifying expressions for: @test-add-call2 ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ 0, %entry ] ; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index32 = add nsw i32 %i, %offset ; CHECK-NEXT: --> {%offset,+,1}<%loop> U: full-set S: full-set Exits: (-1 + %offset + %numIterations) LoopDispositions: { %loop: Computable } -; CHECK-NEXT: %ptr = getelementptr inbounds float, float* %input, i32 %index32 +; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i32 %index32 ; CHECK-NEXT: --> ((4 * (sext i32 {%offset,+,1}<%loop> to i64)) + %input) U: full-set S: full-set Exits: ((4 * (sext i32 (-1 + %offset + %numIterations) to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 ; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,0) S: [1,0) Exits: %numIterations LoopDispositions: { %loop: Computable } @@ -721,10 +721,10 @@ loop: %index32 = add nsw i32 %i, %offset - %ptr = getelementptr inbounds float, float* %input, i32 %index32 + %ptr = getelementptr inbounds float, ptr %input, i32 %index32 %nexti = add nsw i32 %i, 1 call void @foo() - %f = load float, float* %ptr, align 4 + %f = load float, ptr %ptr, align 4 %exitcond = icmp eq i32 %nexti, %numIterations br i1 %exitcond, label %exit, label %loop exit: @@ -732,14 +732,14 @@ exit: } ; Any poison input makes getelementptr produce poison -define void @test-gep-propagates-poison(float* %input, i32 %offset, i32 %numIterations) { +define void @test-gep-propagates-poison(ptr %input, i32 %offset, i32 %numIterations) { ; CHECK-LABEL: 'test-gep-propagates-poison' ; CHECK-NEXT: Classifying expressions for: @test-gep-propagates-poison ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ 0, %entry ] ; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index32 = add nsw i32 %i, %offset ; CHECK-NEXT: --> {%offset,+,1}<%loop> U: full-set S: full-set Exits: (-1 + %offset + %numIterations) LoopDispositions: { %loop: Computable } -; CHECK-NEXT: %ptr = getelementptr float, float* %input, i32 %index32 +; CHECK-NEXT: %ptr = getelementptr float, ptr %input, i32 %index32 ; CHECK-NEXT: --> {((4 * (sext i32 %offset to i64)) + %input),+,4}<%loop> U: full-set S: full-set Exits: ((4 * (zext i32 (-1 + %numIterations) to i64)) + (4 * (sext i32 %offset to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 ; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,-2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } @@ -758,9 +758,9 @@ loop: %index32 = add nsw i32 %i, %offset - %ptr = getelementptr float, float* %input, i32 %index32 + %ptr = getelementptr float, ptr %input, i32 %index32 %nexti = add nsw i32 %i, 1 - %f = load float, float* %ptr, align 4 + %f = load float, ptr %ptr, align 4 %exitcond = icmp eq i32 %nexti, %numIterations br i1 %exitcond, label %exit, label %loop exit: @@ -769,7 +769,7 @@ exit: ; Multiplication by a non-zero constant propagates poison if there is ; a nuw or nsw flag on the multiplication. -define void @test-add-mul-propagates(float* %input, i32 %offset, i32 %numIterations) { +define void @test-add-mul-propagates(ptr %input, i32 %offset, i32 %numIterations) { ; CHECK-LABEL: 'test-add-mul-propagates' ; CHECK-NEXT: Classifying expressions for: @test-add-mul-propagates ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ 0, %entry ] @@ -778,7 +778,7 @@ define void @test-add-mul-propagates(float* %input, i32 %offset, i32 %numIterati ; CHECK-NEXT: --> {%offset,+,1}<%loop> U: full-set S: full-set Exits: (-1 + %offset + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %indexmul = mul nuw i32 %index32, 2 ; CHECK-NEXT: --> {(2 * %offset),+,2}<%loop> U: [0,-1) S: [-2147483648,2147483647) Exits: (-2 + (2 * %offset) + (2 * %numIterations)) LoopDispositions: { %loop: Computable } -; CHECK-NEXT: %ptr = getelementptr inbounds float, float* %input, i32 %indexmul +; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i32 %indexmul ; CHECK-NEXT: --> ((4 * (sext i32 {(2 * %offset),+,2}<%loop> to i64)) + %input) U: full-set S: full-set Exits: ((4 * (sext i32 (-2 + (2 * %offset) + (2 * %numIterations)) to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 ; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,-2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } @@ -798,9 +798,9 @@ loop: %index32 = add nsw i32 %i, %offset %indexmul = mul nuw i32 %index32, 2 - %ptr = getelementptr inbounds float, float* %input, i32 %indexmul + %ptr = getelementptr inbounds float, ptr %input, i32 %indexmul %nexti = add nsw i32 %i, 1 - %f = load float, float* %ptr, align 4 + %f = load float, ptr %ptr, align 4 %exitcond = icmp eq i32 %nexti, %numIterations br i1 %exitcond, label %exit, label %loop exit: @@ -808,7 +808,7 @@ exit: } ; Any poison input to multiplication propages poison. -define void @test-mul-propagates-poison(float* %input, i32 %offset, i32 %numIterations) { +define void @test-mul-propagates-poison(ptr %input, i32 %offset, i32 %numIterations) { ; CHECK-LABEL: 'test-mul-propagates-poison' ; CHECK-NEXT: Classifying expressions for: @test-mul-propagates-poison ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ 0, %entry ] @@ -817,7 +817,7 @@ define void @test-mul-propagates-poison(float* %input, i32 %offset, i32 %numIter ; CHECK-NEXT: --> {%offset,+,1}<%loop> U: full-set S: full-set Exits: (-1 + %offset + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %indexmul = mul nsw i32 %index32, %offset ; CHECK-NEXT: --> {(%offset * %offset),+,%offset}<%loop> U: full-set S: full-set Exits: ((-1 + %offset + %numIterations) * %offset) LoopDispositions: { %loop: Computable } -; CHECK-NEXT: %ptr = getelementptr inbounds float, float* %input, i32 %indexmul +; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i32 %indexmul ; CHECK-NEXT: --> {((4 * (sext i32 (%offset * %offset) to i64)) + %input),+,(4 * (sext i32 %offset to i64))}<%loop> U: full-set S: full-set Exits: ((4 * (sext i32 (%offset * %offset) to i64)) + (4 * (zext i32 (-1 + %numIterations) to i64) * (sext i32 %offset to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 ; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,-2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } @@ -837,16 +837,16 @@ loop: %index32 = add nsw i32 %i, %offset %indexmul = mul nsw i32 %index32, %offset - %ptr = getelementptr inbounds float, float* %input, i32 %indexmul + %ptr = getelementptr inbounds float, ptr %input, i32 %indexmul %nexti = add nsw i32 %i, 1 - %f = load float, float* %ptr, align 4 + %f = load float, ptr %ptr, align 4 %exitcond = icmp eq i32 %nexti, %numIterations br i1 %exitcond, label %exit, label %loop exit: ret void } -define void @test-mul-propagates-poison-2(float* %input, i32 %offset, i32 %numIterations) { +define void @test-mul-propagates-poison-2(ptr %input, i32 %offset, i32 %numIterations) { ; CHECK-LABEL: 'test-mul-propagates-poison-2' ; CHECK-NEXT: Classifying expressions for: @test-mul-propagates-poison-2 ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ 0, %entry ] @@ -855,7 +855,7 @@ define void @test-mul-propagates-poison-2(float* %input, i32 %offset, i32 %numIt ; CHECK-NEXT: --> {%offset,+,1}<%loop> U: full-set S: full-set Exits: (-1 + %offset + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %indexmul = mul i32 %index32, 2 ; CHECK-NEXT: --> {(2 * %offset),+,2}<%loop> U: [0,-1) S: [-2147483648,2147483647) Exits: (-2 + (2 * %offset) + (2 * %numIterations)) LoopDispositions: { %loop: Computable } -; CHECK-NEXT: %ptr = getelementptr inbounds float, float* %input, i32 %indexmul +; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i32 %indexmul ; CHECK-NEXT: --> ((4 * (sext i32 {(2 * %offset),+,2}<%loop> to i64)) + %input) U: full-set S: full-set Exits: ((4 * (sext i32 (-2 + (2 * %offset) + (2 * %numIterations)) to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 ; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,-2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } @@ -875,9 +875,9 @@ loop: %index32 = add nsw i32 %i, %offset %indexmul = mul i32 %index32, 2 - %ptr = getelementptr inbounds float, float* %input, i32 %indexmul + %ptr = getelementptr inbounds float, ptr %input, i32 %indexmul %nexti = add nsw i32 %i, 1 - %f = load float, float* %ptr, align 4 + %f = load float, ptr %ptr, align 4 %exitcond = icmp eq i32 %nexti, %numIterations br i1 %exitcond, label %exit, label %loop exit: @@ -885,7 +885,7 @@ exit: } ; Division by poison triggers UB. -define void @test-add-div(float* %input, i32 %offset, i32 %numIterations) { +define void @test-add-div(ptr %input, i32 %offset, i32 %numIterations) { ; CHECK-LABEL: 'test-add-div' ; CHECK-NEXT: Classifying expressions for: @test-add-div ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ 0, %entry ] @@ -920,7 +920,7 @@ exit: } ; Remainder of poison by non-poison divisor does not trigger UB. -define void @test-add-div2(float* %input, i32 %offset, i32 %numIterations) { +define void @test-add-div2(ptr %input, i32 %offset, i32 %numIterations) { ; CHECK-LABEL: 'test-add-div2' ; CHECK-NEXT: Classifying expressions for: @test-add-div2 ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ 0, %entry ] @@ -955,14 +955,14 @@ exit: } ; Store to poison address triggers UB. -define void @test-add-store(float* %input, i32 %offset, i32 %numIterations) { +define void @test-add-store(ptr %input, i32 %offset, i32 %numIterations) { ; CHECK-LABEL: 'test-add-store' ; CHECK-NEXT: Classifying expressions for: @test-add-store ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ 0, %entry ] ; CHECK-NEXT: --> {0,+,1}<%loop> U: [0,-2147483648) S: [0,-2147483648) Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index32 = add nsw i32 %i, %offset ; CHECK-NEXT: --> {%offset,+,1}<%loop> U: full-set S: full-set Exits: (-1 + %offset + %numIterations) LoopDispositions: { %loop: Computable } -; CHECK-NEXT: %ptr = getelementptr inbounds float, float* %input, i32 %index32 +; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i32 %index32 ; CHECK-NEXT: --> {((4 * (sext i32 %offset to i64)) + %input),+,4}<%loop> U: full-set S: full-set Exits: ((4 * (zext i32 (-1 + %numIterations) to i64)) + (4 * (sext i32 %offset to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 ; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,-2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } @@ -981,9 +981,9 @@ loop: %index32 = add nsw i32 %i, %offset - %ptr = getelementptr inbounds float, float* %input, i32 %index32 + %ptr = getelementptr inbounds float, ptr %input, i32 %index32 %nexti = add nsw i32 %i, 1 - store float 1.0, float* %ptr, align 4 + store float 1.0, ptr %ptr, align 4 %exitcond = icmp eq i32 %nexti, %numIterations br i1 %exitcond, label %exit, label %loop exit: @@ -994,7 +994,7 @@ exit: ; a special case for sequential adds and this test covers that. We have to ; put the final add first in the program since otherwise the special case ; is not triggered, hence the strange basic block ordering. -define void @test-add-twice(float* %input, i32 %offset, i32 %numIterations) { +define void @test-add-twice(ptr %input, i32 %offset, i32 %numIterations) { ; CHECK-LABEL: 'test-add-twice' ; CHECK-NEXT: Classifying expressions for: @test-add-twice ; CHECK-NEXT: %seq = add nuw nsw i32 %index32, 1 @@ -1005,7 +1005,7 @@ define void @test-add-twice(float* %input, i32 %offset, i32 %numIterations) { ; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,-2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index32 = add nsw i32 %j, %offset ; CHECK-NEXT: --> {(1 + %offset),+,1}<%loop> U: [-2147483647,-2147483648) S: [-2147483647,-2147483648) Exits: (%offset + %numIterations) LoopDispositions: { %loop: Computable } -; CHECK-NEXT: %ptr = getelementptr inbounds float, float* %input, i32 %index32 +; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i32 %index32 ; CHECK-NEXT: --> {(4 + (4 * (sext i32 %offset to i64)) + %input),+,4}<%loop> U: full-set S: full-set Exits: (4 + (4 * (zext i32 (-1 + %numIterations) to i64)) + (4 * (sext i32 %offset to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 ; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,-2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } @@ -1030,9 +1030,9 @@ loop: %j = add nsw i32 %i, 1 %index32 = add nsw i32 %j, %offset - %ptr = getelementptr inbounds float, float* %input, i32 %index32 + %ptr = getelementptr inbounds float, ptr %input, i32 %index32 %nexti = add nsw i32 %i, 1 - store float 1.0, float* %ptr, align 4 + store float 1.0, ptr %ptr, align 4 br label %loop2 exit: ret void @@ -1040,7 +1040,7 @@ exit: ; Example where a mul should get the nsw flag, so that a sext can be ; distributed over the mul. -define void @test-mul-nsw(float* %input, i32 %stride, i32 %numIterations) { +define void @test-mul-nsw(ptr %input, i32 %stride, i32 %numIterations) { ; CHECK-LABEL: 'test-mul-nsw' ; CHECK-NEXT: Classifying expressions for: @test-mul-nsw ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ 0, %entry ] @@ -1049,7 +1049,7 @@ define void @test-mul-nsw(float* %input, i32 %stride, i32 %numIterations) { ; CHECK-NEXT: --> {0,+,%stride}<%loop> U: full-set S: full-set Exits: ((-1 + %numIterations) * %stride) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index64 = sext i32 %index32 to i64 ; CHECK-NEXT: --> {0,+,(sext i32 %stride to i64)}<%loop> U: [-9223372034707292160,9223372030412324866) S: [-9223372034707292160,9223372030412324866) Exits: ((zext i32 (-1 + %numIterations) to i64) * (sext i32 %stride to i64)) LoopDispositions: { %loop: Computable } -; CHECK-NEXT: %ptr = getelementptr inbounds float, float* %input, i64 %index64 +; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i64 %index64 ; CHECK-NEXT: --> {%input,+,(4 * (sext i32 %stride to i64))}<%loop> U: full-set S: full-set Exits: ((4 * (zext i32 (-1 + %numIterations) to i64) * (sext i32 %stride to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 ; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,-2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } @@ -1070,9 +1070,9 @@ loop: %index64 = sext i32 %index32 to i64 - %ptr = getelementptr inbounds float, float* %input, i64 %index64 + %ptr = getelementptr inbounds float, ptr %input, i64 %index64 %nexti = add nsw i32 %i, 1 - %f = load float, float* %ptr, align 4 + %f = load float, ptr %ptr, align 4 %exitcond = icmp eq i32 %nexti, %numIterations br i1 %exitcond, label %exit, label %loop exit: @@ -1080,14 +1080,14 @@ exit: } ; Example where a mul should get the nuw flag. -define void @test-mul-nuw(float* %input, i32 %stride, i32 %numIterations) { +define void @test-mul-nuw(ptr %input, i32 %stride, i32 %numIterations) { ; CHECK-LABEL: 'test-mul-nuw' ; CHECK-NEXT: Classifying expressions for: @test-mul-nuw ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ 0, %entry ] ; CHECK-NEXT: --> {0,+,1}<%loop> U: full-set S: full-set Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index32 = mul nuw i32 %i, %stride ; CHECK-NEXT: --> {0,+,%stride}<%loop> U: full-set S: full-set Exits: ((-1 + %numIterations) * %stride) LoopDispositions: { %loop: Computable } -; CHECK-NEXT: %ptr = getelementptr inbounds float, float* %input, i32 %index32 +; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i32 %index32 ; CHECK-NEXT: --> ((4 * (sext i32 {0,+,%stride}<%loop> to i64)) + %input) U: full-set S: full-set Exits: ((4 * (sext i32 ((-1 + %numIterations) * %stride) to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nuw i32 %i, 1 ; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,0) S: [1,0) Exits: %numIterations LoopDispositions: { %loop: Computable } @@ -1106,9 +1106,9 @@ loop: %index32 = mul nuw i32 %i, %stride - %ptr = getelementptr inbounds float, float* %input, i32 %index32 + %ptr = getelementptr inbounds float, ptr %input, i32 %index32 %nexti = add nuw i32 %i, 1 - %f = load float, float* %ptr, align 4 + %f = load float, ptr %ptr, align 4 %exitcond = icmp eq i32 %nexti, %numIterations br i1 %exitcond, label %exit, label %loop @@ -1118,7 +1118,7 @@ exit: ; Example where a shl should get the nsw flag, so that a sext can be ; distributed over the shl. -define void @test-shl-nsw(float* %input, i32 %start, i32 %numIterations) { +define void @test-shl-nsw(ptr %input, i32 %start, i32 %numIterations) { ; CHECK-LABEL: 'test-shl-nsw' ; CHECK-NEXT: Classifying expressions for: @test-shl-nsw ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ %start, %entry ] @@ -1127,7 +1127,7 @@ define void @test-shl-nsw(float* %input, i32 %start, i32 %numIterations) { ; CHECK-NEXT: --> {(256 * %start),+,256}<%loop> U: [0,-255) S: [-2147483648,2147483393) Exits: (-256 + (256 * %numIterations)) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index64 = sext i32 %index32 to i64 ; CHECK-NEXT: --> {(sext i32 (256 * %start) to i64),+,256}<%loop> U: [0,-255) S: [-2147483648,1101659110913) Exits: ((sext i32 (256 * %start) to i64) + (256 * (zext i32 (-1 + (-1 * %start) + %numIterations) to i64))) LoopDispositions: { %loop: Computable } -; CHECK-NEXT: %ptr = getelementptr inbounds float, float* %input, i64 %index64 +; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i64 %index64 ; CHECK-NEXT: --> {((4 * (sext i32 (256 * %start) to i64)) + %input),+,1024}<%loop> U: full-set S: full-set Exits: ((4 * (sext i32 (256 * %start) to i64)) + (1024 * (zext i32 (-1 + (-1 * %start) + %numIterations) to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 ; CHECK-NEXT: --> {(1 + %start),+,1}<%loop> U: full-set S: full-set Exits: %numIterations LoopDispositions: { %loop: Computable } @@ -1148,9 +1148,9 @@ loop: %index64 = sext i32 %index32 to i64 - %ptr = getelementptr inbounds float, float* %input, i64 %index64 + %ptr = getelementptr inbounds float, ptr %input, i64 %index64 %nexti = add nsw i32 %i, 1 - %f = load float, float* %ptr, align 4 + %f = load float, ptr %ptr, align 4 %exitcond = icmp eq i32 %nexti, %numIterations br i1 %exitcond, label %exit, label %loop exit: @@ -1158,7 +1158,7 @@ exit: } ; Example where a shl should get the nuw flag -define void @test-shl-nuw-edgecase(float* %input, i32 %start, i32 %numIterations) { +define void @test-shl-nuw-edgecase(ptr %input, i32 %start, i32 %numIterations) { ; CHECK-LABEL: 'test-shl-nuw-edgecase' ; CHECK-NEXT: Classifying expressions for: @test-shl-nuw-edgecase ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ %start, %entry ] @@ -1167,7 +1167,7 @@ define void @test-shl-nuw-edgecase(float* %input, i32 %start, i32 %numIterations ; CHECK-NEXT: --> {(-2147483648 * %start),+,-2147483648}<%loop> U: [0,-2147483647) S: [-2147483648,1) Exits: (-2147483648 + (-2147483648 * %numIterations)) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index64 = sext i32 %index32 to i64 ; CHECK-NEXT: --> (sext i32 {(-2147483648 * %start),+,-2147483648}<%loop> to i64) U: [0,-2147483647) S: [-2147483648,1) Exits: (sext i32 (-2147483648 + (-2147483648 * %numIterations)) to i64) LoopDispositions: { %loop: Computable } -; CHECK-NEXT: %ptr = getelementptr inbounds float, float* %input, i64 %index64 +; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i64 %index64 ; CHECK-NEXT: --> ((4 * (sext i32 {(-2147483648 * %start),+,-2147483648}<%loop> to i64)) + %input) U: full-set S: full-set Exits: ((4 * (sext i32 (-2147483648 + (-2147483648 * %numIterations)) to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 ; CHECK-NEXT: --> {(1 + %start),+,1}<%loop> U: full-set S: full-set Exits: %numIterations LoopDispositions: { %loop: Computable } @@ -1188,9 +1188,9 @@ loop: %index64 = sext i32 %index32 to i64 - %ptr = getelementptr inbounds float, float* %input, i64 %index64 + %ptr = getelementptr inbounds float, ptr %input, i64 %index64 %nexti = add nsw i32 %i, 1 - %f = load float, float* %ptr, align 4 + %f = load float, ptr %ptr, align 4 %exitcond = icmp eq i32 %nexti, %numIterations br i1 %exitcond, label %exit, label %loop exit: @@ -1198,7 +1198,7 @@ exit: } ; Example where a shl should get the nuw flag -define void @test-shl-nuw-nsw(float* %input, i32 %start, i32 %numIterations) { +define void @test-shl-nuw-nsw(ptr %input, i32 %start, i32 %numIterations) { ; CHECK-LABEL: 'test-shl-nuw-nsw' ; CHECK-NEXT: Classifying expressions for: @test-shl-nuw-nsw ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ %start, %entry ] @@ -1207,7 +1207,7 @@ define void @test-shl-nuw-nsw(float* %input, i32 %start, i32 %numIterations) { ; CHECK-NEXT: --> {(-2147483648 * %start),+,-2147483648}<%loop> U: [0,-2147483647) S: [-2147483648,1) Exits: (-2147483648 + (-2147483648 * %numIterations)) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index64 = sext i32 %index32 to i64 ; CHECK-NEXT: --> {(sext i32 (-2147483648 * %start) to i64),+,-2147483648}<%loop> U: [0,-2147483647) S: [-9223372036854775808,1) Exits: ((sext i32 (-2147483648 * %start) to i64) + (-2147483648 * (zext i32 (-1 + (-1 * %start) + %numIterations) to i64))) LoopDispositions: { %loop: Computable } -; CHECK-NEXT: %ptr = getelementptr inbounds float, float* %input, i64 %index64 +; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i64 %index64 ; CHECK-NEXT: --> {((4 * (sext i32 (-2147483648 * %start) to i64)) + %input),+,-8589934592}<%loop> U: full-set S: full-set Exits: ((4 * (sext i32 (-2147483648 * %start) to i64)) + (-8589934592 * (zext i32 (-1 + (-1 * %start) + %numIterations) to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 ; CHECK-NEXT: --> {(1 + %start),+,1}<%loop> U: full-set S: full-set Exits: %numIterations LoopDispositions: { %loop: Computable } @@ -1228,9 +1228,9 @@ loop: %index64 = sext i32 %index32 to i64 - %ptr = getelementptr inbounds float, float* %input, i64 %index64 + %ptr = getelementptr inbounds float, ptr %input, i64 %index64 %nexti = add nsw i32 %i, 1 - %f = load float, float* %ptr, align 4 + %f = load float, ptr %ptr, align 4 %exitcond = icmp eq i32 %nexti, %numIterations br i1 %exitcond, label %exit, label %loop exit: @@ -1238,7 +1238,7 @@ exit: } ; Example where a shl should not get the nsw flag -define void @test-shl-no-nsw(float* %input, i32 %start, i32 %numIterations) { +define void @test-shl-no-nsw(ptr %input, i32 %start, i32 %numIterations) { ; CHECK-LABEL: 'test-shl-no-nsw' ; CHECK-NEXT: Classifying expressions for: @test-shl-no-nsw ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ %start, %entry ] @@ -1247,7 +1247,7 @@ define void @test-shl-no-nsw(float* %input, i32 %start, i32 %numIterations) { ; CHECK-NEXT: --> {(-2147483648 * %start),+,-2147483648}<%loop> U: [0,-2147483647) S: [-2147483648,1) Exits: (-2147483648 + (-2147483648 * %numIterations)) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index64 = sext i32 %index32 to i64 ; CHECK-NEXT: --> (sext i32 {(-2147483648 * %start),+,-2147483648}<%loop> to i64) U: [0,-2147483647) S: [-2147483648,1) Exits: (sext i32 (-2147483648 + (-2147483648 * %numIterations)) to i64) LoopDispositions: { %loop: Computable } -; CHECK-NEXT: %ptr = getelementptr inbounds float, float* %input, i64 %index64 +; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i64 %index64 ; CHECK-NEXT: --> ((4 * (sext i32 {(-2147483648 * %start),+,-2147483648}<%loop> to i64)) + %input) U: full-set S: full-set Exits: ((4 * (sext i32 (-2147483648 + (-2147483648 * %numIterations)) to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 ; CHECK-NEXT: --> {(1 + %start),+,1}<%loop> U: full-set S: full-set Exits: %numIterations LoopDispositions: { %loop: Computable } @@ -1268,9 +1268,9 @@ loop: %index64 = sext i32 %index32 to i64 - %ptr = getelementptr inbounds float, float* %input, i64 %index64 + %ptr = getelementptr inbounds float, ptr %input, i64 %index64 %nexti = add nsw i32 %i, 1 - %f = load float, float* %ptr, align 4 + %f = load float, ptr %ptr, align 4 %exitcond = icmp eq i32 %nexti, %numIterations br i1 %exitcond, label %exit, label %loop exit: @@ -1278,7 +1278,7 @@ exit: } ; Example where a shl should get the nsw flag. -define void @test-shl-nsw-edgecase(float* %input, i32 %start, i32 %numIterations) { +define void @test-shl-nsw-edgecase(ptr %input, i32 %start, i32 %numIterations) { ; CHECK-LABEL: 'test-shl-nsw-edgecase' ; CHECK-NEXT: Classifying expressions for: @test-shl-nsw-edgecase ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ %start, %entry ] @@ -1287,7 +1287,7 @@ define void @test-shl-nsw-edgecase(float* %input, i32 %start, i32 %numIterations ; CHECK-NEXT: --> {(1073741824 * %start),+,1073741824}<%loop> U: [0,-1073741823) S: [-2147483648,1073741825) Exits: (-1073741824 + (1073741824 * %numIterations)) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index64 = sext i32 %index32 to i64 ; CHECK-NEXT: --> {(sext i32 (1073741824 * %start) to i64),+,1073741824}<%loop> U: [0,-1073741823) S: [-2147483648,4611686018427387905) Exits: ((sext i32 (1073741824 * %start) to i64) + (1073741824 * (zext i32 (-1 + (-1 * %start) + %numIterations) to i64))) LoopDispositions: { %loop: Computable } -; CHECK-NEXT: %ptr = getelementptr inbounds float, float* %input, i64 %index64 +; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i64 %index64 ; CHECK-NEXT: --> {((4 * (sext i32 (1073741824 * %start) to i64)) + %input),+,4294967296}<%loop> U: full-set S: full-set Exits: ((4 * (sext i32 (1073741824 * %start) to i64)) + (4294967296 * (zext i32 (-1 + (-1 * %start) + %numIterations) to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 ; CHECK-NEXT: --> {(1 + %start),+,1}<%loop> U: full-set S: full-set Exits: %numIterations LoopDispositions: { %loop: Computable } @@ -1308,9 +1308,9 @@ loop: %index64 = sext i32 %index32 to i64 - %ptr = getelementptr inbounds float, float* %input, i64 %index64 + %ptr = getelementptr inbounds float, ptr %input, i64 %index64 %nexti = add nsw i32 %i, 1 - %f = load float, float* %ptr, align 4 + %f = load float, ptr %ptr, align 4 %exitcond = icmp eq i32 %nexti, %numIterations br i1 %exitcond, label %exit, label %loop exit: @@ -1318,14 +1318,14 @@ exit: } ; Example where a shl should get the nuw flag. -define void @test-shl-nuw(float* %input, i32 %numIterations) { +define void @test-shl-nuw(ptr %input, i32 %numIterations) { ; CHECK-LABEL: 'test-shl-nuw' ; CHECK-NEXT: Classifying expressions for: @test-shl-nuw ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ 0, %entry ] ; CHECK-NEXT: --> {0,+,1}<%loop> U: full-set S: full-set Exits: (-1 + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index32 = shl nuw i32 %i, 9 ; CHECK-NEXT: --> {0,+,512}<%loop> U: [0,-511) S: [-2147483648,2147483137) Exits: (-512 + (512 * %numIterations)) LoopDispositions: { %loop: Computable } -; CHECK-NEXT: %ptr = getelementptr inbounds float, float* %input, i32 %index32 +; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i32 %index32 ; CHECK-NEXT: --> ((4 * (sext i32 {0,+,512}<%loop> to i64)) + %input) U: full-set S: full-set Exits: ((4 * (sext i32 (-512 + (512 * %numIterations)) to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nuw i32 %i, 1 ; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,0) S: [1,0) Exits: %numIterations LoopDispositions: { %loop: Computable } @@ -1344,9 +1344,9 @@ loop: %index32 = shl nuw i32 %i, 9 - %ptr = getelementptr inbounds float, float* %input, i32 %index32 + %ptr = getelementptr inbounds float, ptr %input, i32 %index32 %nexti = add nuw i32 %i, 1 - %f = load float, float* %ptr, align 4 + %f = load float, ptr %ptr, align 4 %exitcond = icmp eq i32 %nexti, %numIterations br i1 %exitcond, label %exit, label %loop @@ -1357,7 +1357,7 @@ exit: ; Example where a sub should *not* get the nsw flag, because of how ; scalar evolution represents A - B as A + (-B) and -B can wrap even ; in cases where A - B does not. -define void @test-sub-no-nsw(float* %input, i32 %start, i32 %sub, i32 %numIterations) { +define void @test-sub-no-nsw(ptr %input, i32 %start, i32 %sub, i32 %numIterations) { ; CHECK-LABEL: 'test-sub-no-nsw' ; CHECK-NEXT: Classifying expressions for: @test-sub-no-nsw ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ %start, %entry ] @@ -1366,7 +1366,7 @@ define void @test-sub-no-nsw(float* %input, i32 %start, i32 %sub, i32 %numIterat ; CHECK-NEXT: --> {((-1 * %sub) + %start),+,1}<%loop> U: full-set S: full-set Exits: (-1 + (-1 * %sub) + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index64 = sext i32 %index32 to i64 ; CHECK-NEXT: --> {((sext i32 %start to i64) + (-1 * (sext i32 %sub to i64))),+,1}<%loop> U: [-4294967295,8589934591) S: [-4294967295,8589934591) Exits: ((zext i32 (-1 + (-1 * %start) + %numIterations) to i64) + (sext i32 %start to i64) + (-1 * (sext i32 %sub to i64))) LoopDispositions: { %loop: Computable } -; CHECK-NEXT: %ptr = getelementptr inbounds float, float* %input, i64 %index64 +; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i64 %index64 ; CHECK-NEXT: --> {((4 * (sext i32 %start to i64)) + (-4 * (sext i32 %sub to i64)) + %input),+,4}<%loop> U: full-set S: full-set Exits: ((4 * (zext i32 (-1 + (-1 * %start) + %numIterations) to i64)) + (4 * (sext i32 %start to i64)) + (-4 * (sext i32 %sub to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 ; CHECK-NEXT: --> {(1 + %start),+,1}<%loop> U: full-set S: full-set Exits: %numIterations LoopDispositions: { %loop: Computable } @@ -1386,9 +1386,9 @@ loop: %index32 = sub nsw i32 %i, %sub %index64 = sext i32 %index32 to i64 - %ptr = getelementptr inbounds float, float* %input, i64 %index64 + %ptr = getelementptr inbounds float, ptr %input, i64 %index64 %nexti = add nsw i32 %i, 1 - %f = load float, float* %ptr, align 4 + %f = load float, ptr %ptr, align 4 %exitcond = icmp eq i32 %nexti, %numIterations br i1 %exitcond, label %exit, label %loop exit: @@ -1397,7 +1397,7 @@ exit: ; Example where a sub should get the nsw flag as the RHS cannot be the ; minimal signed value. -define void @test-sub-nsw(float* %input, i32 %start, i32 %sub, i32 %numIterations) { +define void @test-sub-nsw(ptr %input, i32 %start, i32 %sub, i32 %numIterations) { ; CHECK-LABEL: 'test-sub-nsw' ; CHECK-NEXT: Classifying expressions for: @test-sub-nsw ; CHECK-NEXT: %halfsub = ashr i32 %sub, 1 @@ -1408,7 +1408,7 @@ define void @test-sub-nsw(float* %input, i32 %start, i32 %sub, i32 %numIteration ; CHECK-NEXT: --> {((-1 * %halfsub) + %start),+,1}<%loop> U: full-set S: full-set Exits: (-1 + (-1 * %halfsub) + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index64 = sext i32 %index32 to i64 ; CHECK-NEXT: --> {((sext i32 %start to i64) + (-1 * (sext i32 %halfsub to i64))),+,1}<%loop> U: [-3221225471,7516192767) S: [-3221225471,7516192767) Exits: ((zext i32 (-1 + (-1 * %start) + %numIterations) to i64) + (sext i32 %start to i64) + (-1 * (sext i32 %halfsub to i64))) LoopDispositions: { %loop: Computable } -; CHECK-NEXT: %ptr = getelementptr inbounds float, float* %input, i64 %index64 +; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i64 %index64 ; CHECK-NEXT: --> {((4 * (sext i32 %start to i64)) + (-4 * (sext i32 %halfsub to i64)) + %input),+,4}<%loop> U: full-set S: full-set Exits: ((4 * (zext i32 (-1 + (-1 * %start) + %numIterations) to i64)) + (4 * (sext i32 %start to i64)) + (-4 * (sext i32 %halfsub to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 ; CHECK-NEXT: --> {(1 + %start),+,1}<%loop> U: full-set S: full-set Exits: %numIterations LoopDispositions: { %loop: Computable } @@ -1429,9 +1429,9 @@ loop: %index32 = sub nsw i32 %i, %halfsub %index64 = sext i32 %index32 to i64 - %ptr = getelementptr inbounds float, float* %input, i64 %index64 + %ptr = getelementptr inbounds float, ptr %input, i64 %index64 %nexti = add nsw i32 %i, 1 - %f = load float, float* %ptr, align 4 + %f = load float, ptr %ptr, align 4 %exitcond = icmp eq i32 %nexti, %numIterations br i1 %exitcond, label %exit, label %loop exit: @@ -1440,7 +1440,7 @@ exit: ; Example where a sub should get the nsw flag, since the LHS is non-negative, ; which implies that the RHS cannot be the minimal signed value. -define void @test-sub-nsw-lhs-non-negative(float* %input, i32 %sub, i32 %numIterations) { +define void @test-sub-nsw-lhs-non-negative(ptr %input, i32 %sub, i32 %numIterations) { ; CHECK-LABEL: 'test-sub-nsw-lhs-non-negative' ; CHECK-NEXT: Classifying expressions for: @test-sub-nsw-lhs-non-negative ; CHECK-NEXT: %i = phi i32 [ %nexti, %loop ], [ 0, %entry ] @@ -1449,7 +1449,7 @@ define void @test-sub-nsw-lhs-non-negative(float* %input, i32 %sub, i32 %numIter ; CHECK-NEXT: --> {(-1 * %sub),+,1}<%loop> U: full-set S: full-set Exits: (-1 + (-1 * %sub) + %numIterations) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index64 = sext i32 %index32 to i64 ; CHECK-NEXT: --> {(-1 * (sext i32 %sub to i64)),+,1}<%loop> U: [-2147483647,6442450944) S: [-2147483647,6442450944) Exits: ((zext i32 (-1 + %numIterations) to i64) + (-1 * (sext i32 %sub to i64))) LoopDispositions: { %loop: Computable } -; CHECK-NEXT: %ptr = getelementptr inbounds float, float* %input, i64 %index64 +; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i64 %index64 ; CHECK-NEXT: --> {((-4 * (sext i32 %sub to i64)) + %input),+,4}<%loop> U: full-set S: full-set Exits: ((4 * (zext i32 (-1 + %numIterations) to i64)) + (-4 * (sext i32 %sub to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 ; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,-2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } @@ -1470,9 +1470,9 @@ loop: %index64 = sext i32 %index32 to i64 - %ptr = getelementptr inbounds float, float* %input, i64 %index64 + %ptr = getelementptr inbounds float, ptr %input, i64 %index64 %nexti = add nsw i32 %i, 1 - %f = load float, float* %ptr, align 4 + %f = load float, ptr %ptr, align 4 %exitcond = icmp eq i32 %nexti, %numIterations br i1 %exitcond, label %exit, label %loop exit: @@ -1481,7 +1481,7 @@ exit: ; Example checking that a sext is pushed onto a sub's operands if the sub is an ; overflow intrinsic. -define void @test-sext-sub(float* %input, i32 %sub, i32 %numIterations) { +define void @test-sext-sub(ptr %input, i32 %sub, i32 %numIterations) { ; CHECK-LABEL: 'test-sext-sub' ; CHECK-NEXT: Classifying expressions for: @test-sext-sub ; CHECK-NEXT: %i = phi i32 [ %nexti, %cont ], [ 0, %entry ] @@ -1492,7 +1492,7 @@ define void @test-sext-sub(float* %input, i32 %sub, i32 %numIterations) { ; CHECK-NEXT: --> %ovfl U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Variant } ; CHECK-NEXT: %index64 = sext i32 %val to i64 ; CHECK-NEXT: --> {(-1 * (sext i32 %sub to i64)),+,1}<%loop> U: [-2147483647,6442450944) S: [-2147483647,6442450944) Exits: <> LoopDispositions: { %loop: Computable } -; CHECK-NEXT: %ptr = getelementptr inbounds float, float* %input, i64 %index64 +; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i64 %index64 ; CHECK-NEXT: --> {((-4 * (sext i32 %sub to i64)) + %input),+,4}<%loop> U: full-set S: full-set Exits: <> LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 ; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,0) S: [1,0) Exits: <> LoopDispositions: { %loop: Computable } @@ -1523,9 +1523,9 @@ trap: cont: %index64 = sext i32 %val to i64 - %ptr = getelementptr inbounds float, float* %input, i64 %index64 + %ptr = getelementptr inbounds float, ptr %input, i64 %index64 %nexti = add nsw i32 %i, 1 - %f = load float, float* %ptr, align 4 + %f = load float, ptr %ptr, align 4 %exitcond = icmp eq i32 %nexti, %numIterations br i1 %exitcond, label %exit, label %loop exit: @@ -1536,7 +1536,7 @@ exit: ; a special case for sequential adds/subs and this test covers that. We have to ; put the final add first in the program since otherwise the special case ; is not triggered, hence the strange basic block ordering. -define void @test-sub-with-add(float* %input, i32 %offset, i32 %numIterations) { +define void @test-sub-with-add(ptr %input, i32 %offset, i32 %numIterations) { ; CHECK-LABEL: 'test-sub-with-add' ; CHECK-NEXT: Classifying expressions for: @test-sub-with-add ; CHECK-NEXT: %seq = add nuw nsw i32 %index32, 1 @@ -1547,7 +1547,7 @@ define void @test-sub-with-add(float* %input, i32 %offset, i32 %numIterations) { ; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,-2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %index32 = sub nsw i32 %j, %offset ; CHECK-NEXT: --> {(1 + (-1 * %offset)),+,1}<%loop> U: [-2147483647,-2147483648) S: [-2147483647,-2147483648) Exits: ((-1 * %offset) + %numIterations) LoopDispositions: { %loop: Computable } -; CHECK-NEXT: %ptr = getelementptr inbounds float, float* %input, i32 %index32 +; CHECK-NEXT: %ptr = getelementptr inbounds float, ptr %input, i32 %index32 ; CHECK-NEXT: --> {(4 + (4 * (sext i32 (-1 * %offset) to i64)) + %input),+,4}<%loop> U: full-set S: full-set Exits: (4 + (4 * (zext i32 (-1 + %numIterations) to i64)) + (4 * (sext i32 (-1 * %offset) to i64)) + %input) LoopDispositions: { %loop: Computable } ; CHECK-NEXT: %nexti = add nsw i32 %i, 1 ; CHECK-NEXT: --> {1,+,1}<%loop> U: [1,-2147483648) S: [1,-2147483648) Exits: %numIterations LoopDispositions: { %loop: Computable } @@ -1572,30 +1572,30 @@ loop: %j = add nsw i32 %i, 1 %index32 = sub nsw i32 %j, %offset - %ptr = getelementptr inbounds float, float* %input, i32 %index32 + %ptr = getelementptr inbounds float, ptr %input, i32 %index32 %nexti = add nsw i32 %i, 1 - store float 1.0, float* %ptr, align 4 + store float 1.0, ptr %ptr, align 4 br label %loop2 exit: ret void } ; PR28932: Don't assert on non-SCEV-able value %2. -%struct.anon = type { i8* } -@a = common global %struct.anon* null, align 8 +%struct.anon = type { ptr } +@a = common global ptr null, align 8 @b = common global i32 0, align 4 declare { i32, i1 } @llvm.ssub.with.overflow.i32(i32, i32) declare void @llvm.trap() define i32 @pr28932() { ; CHECK-LABEL: 'pr28932' ; CHECK-NEXT: Classifying expressions for: @pr28932 -; CHECK-NEXT: %pre = load %struct.anon*, %struct.anon** @a, align 8 +; CHECK-NEXT: %pre = load ptr, ptr @a, align 8 ; CHECK-NEXT: --> %pre U: full-set S: full-set -; CHECK-NEXT: %pre7 = load i32, i32* @b, align 4 +; CHECK-NEXT: %pre7 = load i32, ptr @b, align 4 ; CHECK-NEXT: --> %pre7 U: full-set S: full-set ; CHECK-NEXT: %i = phi i32 [ %i3, %cont6 ], [ %pre7, %entry ] ; CHECK-NEXT: --> {%pre7,+,-1}<%for.cond> U: full-set S: full-set Exits: <> LoopDispositions: { %for.cond: Computable } -; CHECK-NEXT: %i1 = phi %struct.anon* [ %ph, %cont6 ], [ %pre, %entry ] +; CHECK-NEXT: %i1 = phi ptr [ %ph, %cont6 ], [ %pre, %entry ] ; CHECK-NEXT: --> %i1 U: full-set S: full-set Exits: <> LoopDispositions: { %for.cond: Variant } ; CHECK-NEXT: %i3 = extractvalue { i32, i1 } %i2, 0 ; CHECK-NEXT: --> {(-1 + %pre7),+,-1}<%for.cond> U: full-set S: full-set Exits: <> LoopDispositions: { %for.cond: Computable } @@ -1603,19 +1603,17 @@ define i32 @pr28932() { ; CHECK-NEXT: --> %i4 U: full-set S: full-set Exits: <> LoopDispositions: { %for.cond: Variant } ; CHECK-NEXT: %idxprom = sext i32 %i3 to i64 ; CHECK-NEXT: --> (sext i32 {(-1 + %pre7),+,-1}<%for.cond> to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648) Exits: <> LoopDispositions: { %for.cond: Computable } -; CHECK-NEXT: %i5 = getelementptr inbounds %struct.anon, %struct.anon* %i1, i64 0, i32 0 -; CHECK-NEXT: --> %i1 U: full-set S: full-set Exits: <> LoopDispositions: { %for.cond: Variant } -; CHECK-NEXT: %i6 = load i8*, i8** %i5, align 8 +; CHECK-NEXT: %i6 = load ptr, ptr %i1, align 8 ; CHECK-NEXT: --> %i6 U: full-set S: full-set Exits: <> LoopDispositions: { %for.cond: Variant } -; CHECK-NEXT: %i7 = getelementptr inbounds i8, i8* %i6, i64 %idxprom +; CHECK-NEXT: %i7 = getelementptr inbounds i8, ptr %i6, i64 %idxprom ; CHECK-NEXT: --> ((sext i32 {(-1 + %pre7),+,-1}<%for.cond> to i64) + %i6) U: full-set S: full-set Exits: <> LoopDispositions: { %for.cond: Variant } -; CHECK-NEXT: %i8 = load i8, i8* %i7, align 1 +; CHECK-NEXT: %i8 = load i8, ptr %i7, align 1 ; CHECK-NEXT: --> %i8 U: full-set S: full-set Exits: <> LoopDispositions: { %for.cond: Variant } ; CHECK-NEXT: %conv5 = sext i8 %i8 to i64 ; CHECK-NEXT: --> (sext i8 %i8 to i64) U: [-128,128) S: [-128,128) Exits: <> LoopDispositions: { %for.cond: Variant } -; CHECK-NEXT: %i9 = inttoptr i64 %conv5 to %struct.anon* +; CHECK-NEXT: %i9 = inttoptr i64 %conv5 to ptr ; CHECK-NEXT: --> %i9 U: full-set S: full-set Exits: <> LoopDispositions: { %for.cond: Variant } -; CHECK-NEXT: %ph = phi %struct.anon* [ %i9, %cont1 ], [ %i1, %if.then ] +; CHECK-NEXT: %ph = phi ptr [ %i9, %cont1 ], [ %i1, %if.then ] ; CHECK-NEXT: --> %ph U: full-set S: full-set Exits: <> LoopDispositions: { %for.cond: Variant } ; CHECK-NEXT: Determining loop execution counts for: @pr28932 ; CHECK-NEXT: Loop %for.cond: Unpredictable backedge-taken count. @@ -1628,22 +1626,21 @@ define i32 @pr28932() { ; CHECK-NEXT: Loop %for.cond: Unpredictable predicated backedge-taken count. ; entry: - %pre = load %struct.anon*, %struct.anon** @a, align 8 - %pre7 = load i32, i32* @b, align 4 + %pre = load ptr, ptr @a, align 8 + %pre7 = load i32, ptr @b, align 4 br label %for.cond for.cond: ; preds = %cont6, %entry %i = phi i32 [ %i3, %cont6 ], [ %pre7, %entry ] - %i1 = phi %struct.anon* [ %ph, %cont6 ], [ %pre, %entry ] - %tobool = icmp eq %struct.anon* %i1, null + %i1 = phi ptr [ %ph, %cont6 ], [ %pre, %entry ] + %tobool = icmp eq ptr %i1, null %i2 = tail call { i32, i1 } @llvm.ssub.with.overflow.i32(i32 %i, i32 1) %i3 = extractvalue { i32, i1 } %i2, 0 %i4 = extractvalue { i32, i1 } %i2, 1 %idxprom = sext i32 %i3 to i64 - %i5 = getelementptr inbounds %struct.anon, %struct.anon* %i1, i64 0, i32 0 - %i6 = load i8*, i8** %i5, align 8 - %i7 = getelementptr inbounds i8, i8* %i6, i64 %idxprom - %i8 = load i8, i8* %i7, align 1 + %i6 = load ptr, ptr %i1, align 8 + %i7 = getelementptr inbounds i8, ptr %i6, i64 %idxprom + %i8 = load i8, ptr %i7, align 1 br i1 %tobool, label %if.else, label %if.then if.then: ; preds = %for.cond @@ -1658,13 +1655,13 @@ if.else: ; preds = %for.cond cont1: ; preds = %if.else %conv5 = sext i8 %i8 to i64 - %i9 = inttoptr i64 %conv5 to %struct.anon* - store %struct.anon* %i9, %struct.anon** @a, align 8 + %i9 = inttoptr i64 %conv5 to ptr + store ptr %i9, ptr @a, align 8 br label %cont6 cont6: ; preds = %cont1, %if.then - %ph = phi %struct.anon* [ %i9, %cont1 ], [ %i1, %if.then ] - store i32 %i3, i32* @b, align 4 + %ph = phi ptr [ %i9, %cont1 ], [ %i1, %if.then ] + store i32 %i3, ptr @b, align 4 br label %for.cond } @@ -1720,7 +1717,7 @@ define noundef i32 @udiv-basic(i32 %a, i32 %b) { define noundef i64 @add-zext-recurse(i64 %arg) { ; CHECK-LABEL: 'add-zext-recurse' ; CHECK-NEXT: Classifying expressions for: @add-zext-recurse -; CHECK-NEXT: %a = load i32, i32* @gA, align 4 +; CHECK-NEXT: %a = load i32, ptr @gA, align 4 ; CHECK-NEXT: --> %a U: full-set S: full-set ; CHECK-NEXT: %x = zext i32 %a to i64 ; CHECK-NEXT: --> (zext i32 %a to i64) U: [0,4294967296) S: [0,4294967296) @@ -1729,7 +1726,7 @@ define noundef i64 @add-zext-recurse(i64 %arg) { ; CHECK-NEXT: Determining loop execution counts for: @add-zext-recurse ; call void @foo() - %a = load i32, i32* @gA + %a = load i32, ptr @gA %x = zext i32 %a to i64 %res = add nuw i64 %x, %arg ret i64 %res @@ -1738,7 +1735,7 @@ define noundef i64 @add-zext-recurse(i64 %arg) { define noundef i64 @add-sext-recurse(i64 %arg) { ; CHECK-LABEL: 'add-sext-recurse' ; CHECK-NEXT: Classifying expressions for: @add-sext-recurse -; CHECK-NEXT: %a = load i32, i32* @gA, align 4 +; CHECK-NEXT: %a = load i32, ptr @gA, align 4 ; CHECK-NEXT: --> %a U: full-set S: full-set ; CHECK-NEXT: %x = sext i32 %a to i64 ; CHECK-NEXT: --> (sext i32 %a to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648) @@ -1747,7 +1744,7 @@ define noundef i64 @add-sext-recurse(i64 %arg) { ; CHECK-NEXT: Determining loop execution counts for: @add-sext-recurse ; call void @foo() - %a = load i32, i32* @gA + %a = load i32, ptr @gA %x = sext i32 %a to i64 %res = add nuw i64 %x, %arg ret i64 %res @@ -1756,7 +1753,7 @@ define noundef i64 @add-sext-recurse(i64 %arg) { define noundef i16 @add-trunc-recurse() { ; CHECK-LABEL: 'add-trunc-recurse' ; CHECK-NEXT: Classifying expressions for: @add-trunc-recurse -; CHECK-NEXT: %a = load i32, i32* @gA, align 4 +; CHECK-NEXT: %a = load i32, ptr @gA, align 4 ; CHECK-NEXT: --> %a U: full-set S: full-set ; CHECK-NEXT: %x = trunc i32 %a to i16 ; CHECK-NEXT: --> (trunc i32 %a to i16) U: full-set S: full-set @@ -1765,7 +1762,7 @@ define noundef i16 @add-trunc-recurse() { ; CHECK-NEXT: Determining loop execution counts for: @add-trunc-recurse ; call void @foo() - %a = load i32, i32* @gA + %a = load i32, ptr @gA %x = trunc i32 %a to i16 %res = add nuw i16 %x, 1 ret i16 %res @@ -1774,7 +1771,7 @@ define noundef i16 @add-trunc-recurse() { define noundef i32 @add-udiv-recurse(i32 %arg) { ; CHECK-LABEL: 'add-udiv-recurse' ; CHECK-NEXT: Classifying expressions for: @add-udiv-recurse -; CHECK-NEXT: %a = load i32, i32* @gA, align 4 +; CHECK-NEXT: %a = load i32, ptr @gA, align 4 ; CHECK-NEXT: --> %a U: full-set S: full-set ; CHECK-NEXT: %x = udiv i32 %a, %arg ; CHECK-NEXT: --> (%a /u %arg) U: full-set S: full-set @@ -1783,7 +1780,7 @@ define noundef i32 @add-udiv-recurse(i32 %arg) { ; CHECK-NEXT: Determining loop execution counts for: @add-udiv-recurse ; call void @foo() - %a = load i32, i32* @gA + %a = load i32, ptr @gA %x = udiv i32 %a, %arg %res = add nuw i32 %x, 1 ret i32 %res @@ -1792,7 +1789,7 @@ define noundef i32 @add-udiv-recurse(i32 %arg) { define noundef i32 @add-mul-recurse() { ; CHECK-LABEL: 'add-mul-recurse' ; CHECK-NEXT: Classifying expressions for: @add-mul-recurse -; CHECK-NEXT: %a = load i32, i32* @gA, align 4 +; CHECK-NEXT: %a = load i32, ptr @gA, align 4 ; CHECK-NEXT: --> %a U: full-set S: full-set ; CHECK-NEXT: %x = mul i32 %a, 3 ; CHECK-NEXT: --> (3 * %a) U: full-set S: full-set @@ -1801,7 +1798,7 @@ define noundef i32 @add-mul-recurse() { ; CHECK-NEXT: Determining loop execution counts for: @add-mul-recurse ; call void @foo() - %a = load i32, i32* @gA + %a = load i32, ptr @gA %x = mul i32 %a, 3 %res = add nuw i32 %x, 1 ret i32 %res @@ -1815,7 +1812,7 @@ declare i32 @llvm.umax.i32(i32, i32) define noundef i32 @add-smin-recurse(i32 %arg) { ; CHECK-LABEL: 'add-smin-recurse' ; CHECK-NEXT: Classifying expressions for: @add-smin-recurse -; CHECK-NEXT: %a = load i32, i32* @gA, align 4 +; CHECK-NEXT: %a = load i32, ptr @gA, align 4 ; CHECK-NEXT: --> %a U: full-set S: full-set ; CHECK-NEXT: %x = call i32 @llvm.smin.i32(i32 %a, i32 %arg) ; CHECK-NEXT: --> (%arg smin %a) U: full-set S: full-set @@ -1824,7 +1821,7 @@ define noundef i32 @add-smin-recurse(i32 %arg) { ; CHECK-NEXT: Determining loop execution counts for: @add-smin-recurse ; call void @foo() - %a = load i32, i32* @gA + %a = load i32, ptr @gA %x = call i32 @llvm.smin.i32(i32 %a, i32 %arg) %res = add nuw i32 %x, 1 ret i32 %res @@ -1833,7 +1830,7 @@ define noundef i32 @add-smin-recurse(i32 %arg) { define noundef i32 @add-smax-recurse(i32 %arg) { ; CHECK-LABEL: 'add-smax-recurse' ; CHECK-NEXT: Classifying expressions for: @add-smax-recurse -; CHECK-NEXT: %a = load i32, i32* @gA, align 4 +; CHECK-NEXT: %a = load i32, ptr @gA, align 4 ; CHECK-NEXT: --> %a U: full-set S: full-set ; CHECK-NEXT: %x = call i32 @llvm.smax.i32(i32 %a, i32 %arg) ; CHECK-NEXT: --> (%arg smax %a) U: full-set S: full-set @@ -1842,7 +1839,7 @@ define noundef i32 @add-smax-recurse(i32 %arg) { ; CHECK-NEXT: Determining loop execution counts for: @add-smax-recurse ; call void @foo() - %a = load i32, i32* @gA + %a = load i32, ptr @gA %x = call i32 @llvm.smax.i32(i32 %a, i32 %arg) %res = add nuw i32 %x, 1 ret i32 %res @@ -1851,7 +1848,7 @@ define noundef i32 @add-smax-recurse(i32 %arg) { define noundef i32 @add-umin-recurse(i32 %arg) { ; CHECK-LABEL: 'add-umin-recurse' ; CHECK-NEXT: Classifying expressions for: @add-umin-recurse -; CHECK-NEXT: %a = load i32, i32* @gA, align 4 +; CHECK-NEXT: %a = load i32, ptr @gA, align 4 ; CHECK-NEXT: --> %a U: full-set S: full-set ; CHECK-NEXT: %x = call i32 @llvm.umin.i32(i32 %a, i32 %arg) ; CHECK-NEXT: --> (%arg umin %a) U: full-set S: full-set @@ -1860,7 +1857,7 @@ define noundef i32 @add-umin-recurse(i32 %arg) { ; CHECK-NEXT: Determining loop execution counts for: @add-umin-recurse ; call void @foo() - %a = load i32, i32* @gA + %a = load i32, ptr @gA %x = call i32 @llvm.umin.i32(i32 %a, i32 %arg) %res = add nuw i32 %x, 1 ret i32 %res @@ -1869,7 +1866,7 @@ define noundef i32 @add-umin-recurse(i32 %arg) { define noundef i32 @add-umax-recurse(i32 %arg) { ; CHECK-LABEL: 'add-umax-recurse' ; CHECK-NEXT: Classifying expressions for: @add-umax-recurse -; CHECK-NEXT: %a = load i32, i32* @gA, align 4 +; CHECK-NEXT: %a = load i32, ptr @gA, align 4 ; CHECK-NEXT: --> %a U: full-set S: full-set ; CHECK-NEXT: %x = call i32 @llvm.umax.i32(i32 %a, i32 %arg) ; CHECK-NEXT: --> (%arg umax %a) U: full-set S: full-set @@ -1878,7 +1875,7 @@ define noundef i32 @add-umax-recurse(i32 %arg) { ; CHECK-NEXT: Determining loop execution counts for: @add-umax-recurse ; call void @foo() - %a = load i32, i32* @gA + %a = load i32, ptr @gA %x = call i32 @llvm.umax.i32(i32 %a, i32 %arg) %res = add nuw i32 %x, 1 ret i32 %res @@ -1888,13 +1885,13 @@ define noundef i32 @add-umax-recurse(i32 %arg) { define noundef i32 @add-recurse-inline() { ; CHECK-LABEL: 'add-recurse-inline' ; CHECK-NEXT: Classifying expressions for: @add-recurse-inline -; CHECK-NEXT: %a = load i32, i32* @gA, align 4 +; CHECK-NEXT: %a = load i32, ptr @gA, align 4 ; CHECK-NEXT: --> %a U: full-set S: full-set -; CHECK-NEXT: %b = load i32, i32* @gB, align 4 +; CHECK-NEXT: %b = load i32, ptr @gB, align 4 ; CHECK-NEXT: --> %b U: full-set S: full-set -; CHECK-NEXT: %c = load i32, i32* @gC, align 4 +; CHECK-NEXT: %c = load i32, ptr @gC, align 4 ; CHECK-NEXT: --> %c U: full-set S: full-set -; CHECK-NEXT: %d = load i32, i32* @gD, align 4 +; CHECK-NEXT: %d = load i32, ptr @gD, align 4 ; CHECK-NEXT: --> %d U: full-set S: full-set ; CHECK-NEXT: %x = add nuw i32 %a, %b ; CHECK-NEXT: --> (%a + %b) U: full-set S: full-set @@ -1905,10 +1902,10 @@ define noundef i32 @add-recurse-inline() { ; CHECK-NEXT: Determining loop execution counts for: @add-recurse-inline ; call void @foo() - %a = load i32, i32* @gA - %b = load i32, i32* @gB - %c = load i32, i32* @gC - %d = load i32, i32* @gD + %a = load i32, ptr @gA + %b = load i32, ptr @gB + %c = load i32, ptr @gC + %d = load i32, ptr @gD %x = add nuw i32 %a, %b %y = add nuw i32 %c, %d diff --git a/llvm/test/Analysis/ScalarEvolution/max-mulops-inline.ll b/llvm/test/Analysis/ScalarEvolution/max-mulops-inline.ll index 4a17ce7..8b2ee72 100644 --- a/llvm/test/Analysis/ScalarEvolution/max-mulops-inline.ll +++ b/llvm/test/Analysis/ScalarEvolution/max-mulops-inline.ll @@ -16,14 +16,14 @@ define i32 @main() local_unnamed_addr { ; CHECK10: --> (%a.promoted * %a.promoted * %a.promoted * %a.promoted) entry: - %a.promoted = load i32, i32* @a, align 4 + %a.promoted = load i32, ptr @a, align 4 %mul = mul nsw i32 %a.promoted, %a.promoted %mul.1 = mul nsw i32 %mul, %mul %mul.2 = mul nsw i32 %mul.1, %mul.1 %mul.3 = mul nsw i32 %mul.2, %mul.2 %mul.4 = mul nsw i32 %mul.3, %mul.3 %mul.5 = mul nsw i32 %mul.4, %mul.4 - store i32 %mul.5, i32* @a, align 4 - store i32 31, i32* @b, align 4 + store i32 %mul.5, ptr @a, align 4 + store i32 31, ptr @b, align 4 ret i32 0 } diff --git a/llvm/test/Analysis/ScalarEvolution/overflow-intrinsics.ll b/llvm/test/Analysis/ScalarEvolution/overflow-intrinsics.ll index ed656f8..cc24410 100644 --- a/llvm/test/Analysis/ScalarEvolution/overflow-intrinsics.ll +++ b/llvm/test/Analysis/ScalarEvolution/overflow-intrinsics.ll @@ -3,7 +3,7 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" -define void @f_sadd_0(i8* %a) { +define void @f_sadd_0(ptr %a) { ; CHECK-LABEL: Classifying expressions for: @f_sadd_0 entry: br label %for.body @@ -17,8 +17,8 @@ for.body: ; preds = %entry, %cont %i.04 = phi i32 [ 0, %entry ], [ %tmp2, %cont ] %idxprom = sext i32 %i.04 to i64 - %arrayidx = getelementptr inbounds i8, i8* %a, i64 %idxprom - store i8 0, i8* %arrayidx, align 1 + %arrayidx = getelementptr inbounds i8, ptr %a, i64 %idxprom + store i8 0, ptr %arrayidx, align 1 %tmp0 = tail call { i32, i1 } @llvm.sadd.with.overflow.i32(i32 %i.04, i32 1) %tmp1 = extractvalue { i32, i1 } %tmp0, 1 br i1 %tmp1, label %trap, label %cont, !nosanitize !{} @@ -34,7 +34,7 @@ cont: ; preds = %for.body ; CHECK: Loop %for.body: constant max backedge-taken count is 15 } -define void @f_sadd_1(i8* %a) { +define void @f_sadd_1(ptr %a) { ; CHECK-LABEL: Classifying expressions for: @f_sadd_1 entry: br label %for.body @@ -52,8 +52,8 @@ for.body: ; preds = %entry, %cont %i.04 = phi i32 [ 0, %entry ], [ %tmp2, %cont ] %idxprom = sext i32 %i.04 to i64 - %arrayidx = getelementptr inbounds i8, i8* %a, i64 %idxprom - store i8 0, i8* %arrayidx, align 1 + %arrayidx = getelementptr inbounds i8, ptr %a, i64 %idxprom + store i8 0, ptr %arrayidx, align 1 %tmp0 = tail call { i32, i1 } @llvm.sadd.with.overflow.i32(i32 %i.04, i32 1) %tmp1 = extractvalue { i32, i1 } %tmp0, 1 br i1 %tmp1, label %trap, label %cont, !nosanitize !{} @@ -69,7 +69,7 @@ cont: ; preds = %for.body ; CHECK: Loop %for.body: constant max backedge-taken count is 15 } -define void @f_sadd_2(i8* %a, i1* %c) { +define void @f_sadd_2(ptr %a, ptr %c) { ; CHECK-LABEL: Classifying expressions for: @f_sadd_2 entry: br label %for.body @@ -83,8 +83,8 @@ for.body: ; preds = %entry, %cont %i.04 = phi i32 [ 0, %entry ], [ %tmp2, %cont ] %idxprom = sext i32 %i.04 to i64 - %arrayidx = getelementptr inbounds i8, i8* %a, i64 %idxprom - store i8 0, i8* %arrayidx, align 1 + %arrayidx = getelementptr inbounds i8, ptr %a, i64 %idxprom + store i8 0, ptr %arrayidx, align 1 %tmp0 = tail call { i32, i1 } @llvm.sadd.with.overflow.i32(i32 %i.04, i32 1) %tmp1 = extractvalue { i32, i1 } %tmp0, 1 br i1 %tmp1, label %trap, label %cont, !nosanitize !{} @@ -95,11 +95,11 @@ trap: ; preds = %for.body cont: ; preds = %for.body %tmp2 = extractvalue { i32, i1 } %tmp0, 0 - %cond = load volatile i1, i1* %c + %cond = load volatile i1, ptr %c br i1 %cond, label %for.body, label %for.cond.cleanup } -define void @f_sadd_3(i8* %a, i1* %c) { +define void @f_sadd_3(ptr %a, ptr %c) { ; CHECK-LABEL: Classifying expressions for: @f_sadd_3 entry: br label %for.body @@ -113,8 +113,8 @@ for.body: ; preds = %entry, %cont %i.04 = phi i32 [ 0, %entry ], [ %tmp2, %for.body ] %idxprom = sext i32 %i.04 to i64 - %arrayidx = getelementptr inbounds i8, i8* %a, i64 %idxprom - store i8 0, i8* %arrayidx, align 1 + %arrayidx = getelementptr inbounds i8, ptr %a, i64 %idxprom + store i8 0, ptr %arrayidx, align 1 %tmp0 = tail call { i32, i1 } @llvm.sadd.with.overflow.i32(i32 %i.04, i32 1) %tmp1 = extractvalue { i32, i1 } %tmp0, 1 %tmp2 = extractvalue { i32, i1 } %tmp0, 0 @@ -125,7 +125,7 @@ trap: ; preds = %for.body unreachable, !nosanitize !{} } -define void @f_sadd_4(i8* %a, i1* %c) { +define void @f_sadd_4(ptr %a, ptr %c) { ; CHECK-LABEL: Classifying expressions for: @f_sadd_4 entry: br label %for.body @@ -139,8 +139,8 @@ for.body: ; preds = %entry, %cont %i.04 = phi i32 [ 0, %entry ], [ %tmp2, %merge ] %idxprom = sext i32 %i.04 to i64 - %arrayidx = getelementptr inbounds i8, i8* %a, i64 %idxprom - store i8 0, i8* %arrayidx, align 1 + %arrayidx = getelementptr inbounds i8, ptr %a, i64 %idxprom + store i8 0, ptr %arrayidx, align 1 %tmp0 = tail call { i32, i1 } @llvm.sadd.with.overflow.i32(i32 %i.04, i32 1) %tmp1 = extractvalue { i32, i1 } %tmp0, 1 %tmp2 = extractvalue { i32, i1 } %tmp0, 0 @@ -158,7 +158,7 @@ trap: ; preds = %for.body unreachable, !nosanitize !{} } -define void @f_sadd_may_overflow(i8* %a, i1* %c) { +define void @f_sadd_may_overflow(ptr %a, ptr %c) { ; CHECK-LABEL: Classifying expressions for: @f_sadd_may_overflow entry: br label %for.body @@ -172,10 +172,10 @@ for.body: ; preds = %entry, %cont %i.04 = phi i32 [ 0, %entry ], [ %tmp1, %cont ] %idxprom = sext i32 %i.04 to i64 - %arrayidx = getelementptr inbounds i8, i8* %a, i64 %idxprom - store i8 0, i8* %arrayidx, align 1 + %arrayidx = getelementptr inbounds i8, ptr %a, i64 %idxprom + store i8 0, ptr %arrayidx, align 1 %tmp0 = tail call { i32, i1 } @llvm.sadd.with.overflow.i32(i32 %i.04, i32 1) - %cond1 = load volatile i1, i1* %c + %cond1 = load volatile i1, ptr %c br i1 %cond1, label %trap, label %cont, !nosanitize !{} trap: ; preds = %for.body @@ -184,11 +184,11 @@ trap: ; preds = %for.body cont: ; preds = %for.body %tmp1 = extractvalue { i32, i1 } %tmp0, 0 - %cond = load volatile i1, i1* %c + %cond = load volatile i1, ptr %c br i1 %cond, label %for.body, label %for.cond.cleanup } -define void @f_uadd(i8* %a) { +define void @f_uadd(ptr %a) { ; CHECK-LABEL: Classifying expressions for: @f_uadd entry: br label %for.body @@ -202,8 +202,8 @@ for.body: ; preds = %entry, %cont %i.04 = phi i32 [ 0, %entry ], [ %tmp2, %cont ] %idxprom = sext i32 %i.04 to i64 - %arrayidx = getelementptr inbounds i8, i8* %a, i64 %idxprom - store i8 0, i8* %arrayidx, align 1 + %arrayidx = getelementptr inbounds i8, ptr %a, i64 %idxprom + store i8 0, ptr %arrayidx, align 1 %tmp0 = tail call { i32, i1 } @llvm.uadd.with.overflow.i32(i32 %i.04, i32 1) %tmp1 = extractvalue { i32, i1 } %tmp0, 1 br i1 %tmp1, label %trap, label %cont, !nosanitize !{} @@ -219,7 +219,7 @@ cont: ; preds = %for.body ; CHECK: Loop %for.body: constant max backedge-taken count is 15 } -define void @f_ssub(i8* nocapture %a) { +define void @f_ssub(ptr nocapture %a) { ; CHECK-LABEL: Classifying expressions for: @f_ssub entry: br label %for.body @@ -233,8 +233,8 @@ for.body: ; preds = %entry, %cont %i.04 = phi i32 [ 15, %entry ], [ %tmp2, %cont ] %idxprom = sext i32 %i.04 to i64 - %arrayidx = getelementptr inbounds i8, i8* %a, i64 %idxprom - store i8 0, i8* %arrayidx, align 1 + %arrayidx = getelementptr inbounds i8, ptr %a, i64 %idxprom + store i8 0, ptr %arrayidx, align 1 %tmp0 = tail call { i32, i1 } @llvm.ssub.with.overflow.i32(i32 %i.04, i32 1) %tmp1 = extractvalue { i32, i1 } %tmp0, 1 br i1 %tmp1, label %trap, label %cont, !nosanitize !{} @@ -250,7 +250,7 @@ cont: ; preds = %for.body ; CHECK: Loop %for.body: constant max backedge-taken count is 15 } -define void @f_usub(i8* nocapture %a) { +define void @f_usub(ptr nocapture %a) { ; CHECK-LABEL: Classifying expressions for: @f_usub entry: br label %for.body @@ -264,8 +264,8 @@ for.body: ; preds = %entry, %cont %i.04 = phi i32 [ 15, %entry ], [ %tmp2, %cont ] %idxprom = sext i32 %i.04 to i64 - %arrayidx = getelementptr inbounds i8, i8* %a, i64 %idxprom - store i8 0, i8* %arrayidx, align 1 + %arrayidx = getelementptr inbounds i8, ptr %a, i64 %idxprom + store i8 0, ptr %arrayidx, align 1 %tmp0 = tail call { i32, i1 } @llvm.usub.with.overflow.i32(i32 %i.04, i32 1) %tmp1 = extractvalue { i32, i1 } %tmp0, 1 br i1 %tmp1, label %trap, label %cont, !nosanitize !{} diff --git a/llvm/test/Analysis/ScalarEvolution/scev-aa.ll b/llvm/test/Analysis/ScalarEvolution/scev-aa.ll index f089b40..a81baa7 100644 --- a/llvm/test/Analysis/ScalarEvolution/scev-aa.ll +++ b/llvm/test/Analysis/ScalarEvolution/scev-aa.ll @@ -12,20 +12,20 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64" ; CHECK-LABEL: Function: loop ; CHECK: NoAlias: double* %pi, double* %pi.next -define void @loop(double* nocapture %p, i64 %n) nounwind { +define void @loop(ptr nocapture %p, i64 %n) nounwind { entry: %j = icmp sgt i64 %n, 0 br i1 %j, label %bb, label %return bb: %i = phi i64 [ 0, %entry ], [ %i.next, %bb ] - %pi = getelementptr double, double* %p, i64 %i + %pi = getelementptr double, ptr %p, i64 %i %i.next = add i64 %i, 1 - %pi.next = getelementptr double, double* %p, i64 %i.next - %x = load double, double* %pi - %y = load double, double* %pi.next + %pi.next = getelementptr double, ptr %p, i64 %i.next + %x = load double, ptr %pi + %y = load double, ptr %pi.next %z = fmul double %x, %y - store double %z, double* %pi + store double %z, ptr %pi %exitcond = icmp eq i64 %i.next, %n br i1 %exitcond, label %return, label %bb @@ -40,7 +40,7 @@ return: ; CHECK: NoAlias: double* %pi.j, double* %pi.j.next ; CHECK: NoAlias: double* %pi.j.next, double* %pi.next.j -define void @nestedloop(double* nocapture %p, i64 %m) nounwind { +define void @nestedloop(ptr nocapture %p, i64 %m) nounwind { entry: %k = icmp sgt i64 %m, 0 br i1 %k, label %guard, label %return @@ -58,20 +58,20 @@ bb: %i.next = add i64 %i, 1 %e = add i64 %i, %j - %pi.j = getelementptr double, double* %p, i64 %e + %pi.j = getelementptr double, ptr %p, i64 %e %f = add i64 %i.next, %j - %pi.next.j = getelementptr double, double* %p, i64 %f - %x = load double, double* %pi.j - %y = load double, double* %pi.next.j + %pi.next.j = getelementptr double, ptr %p, i64 %f + %x = load double, ptr %pi.j + %y = load double, ptr %pi.next.j %z = fmul double %x, %y - store double %z, double* %pi.j + store double %z, ptr %pi.j %o = add i64 %j, 91 %g = add i64 %i, %o - %pi.j.next = getelementptr double, double* %p, i64 %g - %a = load double, double* %pi.j.next + %pi.j.next = getelementptr double, ptr %p, i64 %g + %a = load double, ptr %pi.j.next %b = fmul double %x, %a - store double %b, double* %pi.j.next + store double %b, ptr %pi.j.next %exitcond = icmp eq i64 %i.next, 91 br i1 %exitcond, label %outer.latch, label %bb @@ -97,7 +97,7 @@ return: ; CHECK: NoAlias: double* %pi.j, double* %pi.next.j ; CHECK: MayAlias: double* %pi.j, double* %pi.j.next -define void @nestedloop_more(double* nocapture %p, i64 %n, i64 %m) nounwind { +define void @nestedloop_more(ptr nocapture %p, i64 %n, i64 %m) nounwind { entry: %k = icmp sgt i64 %m, 0 br i1 %k, label %guard, label %return @@ -115,20 +115,20 @@ bb: %i.next = add i64 %i, 1 %e = add i64 %i, %j - %pi.j = getelementptr double, double* %p, i64 %e + %pi.j = getelementptr double, ptr %p, i64 %e %f = add i64 %i.next, %j - %pi.next.j = getelementptr double, double* %p, i64 %f - %x = load double, double* %pi.j - %y = load double, double* %pi.next.j + %pi.next.j = getelementptr double, ptr %p, i64 %f + %x = load double, ptr %pi.j + %y = load double, ptr %pi.next.j %z = fmul double %x, %y - store double %z, double* %pi.j + store double %z, ptr %pi.j %o = add i64 %j, %n %g = add i64 %i, %o - %pi.j.next = getelementptr double, double* %p, i64 %g - %a = load double, double* %pi.j.next + %pi.j.next = getelementptr double, ptr %p, i64 %g + %a = load double, ptr %pi.j.next %b = fmul double %x, %a - store double %b, double* %pi.j.next + store double %b, ptr %pi.j.next %exitcond = icmp eq i64 %i.next, %n br i1 %exitcond, label %outer.latch, label %bb @@ -150,69 +150,63 @@ return: %struct.B = type { double } ; CHECK-LABEL: Function: foo -; CHECK-DAG: NoAlias: %struct.B* %B, i32* %Z -; CHECK-DAG: NoAlias: %struct.B* %B, %struct.B* %C +; CHECK-DAG: NoAlias: %struct.B* %A, i32* %Z +; CHECK-DAG: NoAlias: %struct.B* %A, %struct.B* %C ; CHECK-DAG: MustAlias: %struct.B* %C, i32* %Z -; CHECK-DAG: NoAlias: %struct.B* %B, i32* %X -; CHECK-DAG: MustAlias: i32* %X, i32* %Z +; CHECK-DAG: NoAlias: %struct.B* %A, i32* %C +; CHECK-DAG: MustAlias: i32* %C, i32* %Z ; CHECK-DAG: MustAlias: %struct.B* %C, i32* %Y -; CHECK-DAG: MustAlias: i32* %X, i32* %Y +; CHECK-DAG: MustAlias: i32* %C, i32* %Y define void @foo() { entry: %A = alloca %struct.A - %B = getelementptr %struct.A, %struct.A* %A, i32 0, i32 0 - %Q = bitcast %struct.B* %B to %struct.A* - %Z = getelementptr %struct.A, %struct.A* %Q, i32 0, i32 1 - %C = getelementptr %struct.B, %struct.B* %B, i32 1 - %X = bitcast %struct.B* %C to i32* - %Y = getelementptr %struct.A, %struct.A* %A, i32 0, i32 1 - load %struct.B, %struct.B* %B - load %struct.B, %struct.B* %C - load i32, i32* %X - load i32, i32* %Y - load i32, i32* %Z + %Z = getelementptr %struct.A, ptr %A, i32 0, i32 1 + %C = getelementptr %struct.B, ptr %A, i32 1 + %Y = getelementptr %struct.A, ptr %A, i32 0, i32 1 + load %struct.B, ptr %A + load %struct.B, ptr %C + load i32, ptr %C + load i32, ptr %Y + load i32, ptr %Z ret void } ; CHECK-LABEL: Function: bar -; CHECK-DAG: NoAlias: %struct.B* %N, i32* %P -; CHECK-DAG: NoAlias: %struct.B* %N, %struct.B* %R +; CHECK-DAG: NoAlias: %struct.B* %M, i32* %P +; CHECK-DAG: NoAlias: %struct.B* %M, %struct.B* %R ; CHECK-DAG: MustAlias: i32* %P, %struct.B* %R -; CHECK-DAG: NoAlias: %struct.B* %N, i32* %W -; CHECK-DAG: MustAlias: i32* %P, i32* %W +; CHECK-DAG: NoAlias: %struct.B* %M, i32* %R +; CHECK-DAG: MustAlias: i32* %P, i32* %R ; CHECK-DAG: MustAlias: %struct.B* %R, i32* %V -; CHECK-DAG: MustAlias: i32* %V, i32* %W +; CHECK-DAG: MustAlias: i32* %R, i32* %V define void @bar() { %M = alloca %struct.A - %N = getelementptr %struct.A, %struct.A* %M, i32 0, i32 0 - %O = bitcast %struct.B* %N to %struct.A* - %P = getelementptr %struct.A, %struct.A* %O, i32 0, i32 1 - %R = getelementptr %struct.B, %struct.B* %N, i32 1 - %W = bitcast %struct.B* %R to i32* - %V = getelementptr %struct.A, %struct.A* %M, i32 0, i32 1 - load %struct.B, %struct.B* %N - load %struct.B, %struct.B* %R - load i32, i32* %P - load i32, i32* %V - load i32, i32* %W + %P = getelementptr %struct.A, ptr %M, i32 0, i32 1 + %R = getelementptr %struct.B, ptr %M, i32 1 + %V = getelementptr %struct.A, ptr %M, i32 0, i32 1 + load %struct.B, ptr %M + load %struct.B, ptr %R + load i32, ptr %P + load i32, ptr %V + load i32, ptr %R ret void } ; CHECK: Function: nonnegative: 2 pointers, 0 call sites ; CHECK: NoAlias: i64* %arrayidx, i64* %p -define void @nonnegative(i64* %p) nounwind { +define void @nonnegative(ptr %p) nounwind { entry: br label %for.body for.body: ; preds = %entry, %for.body %i = phi i64 [ %inc, %for.body ], [ 0, %entry ] ; [#uses=2] %inc = add nsw i64 %i, 1 ; [#uses=2] - %arrayidx = getelementptr inbounds i64, i64* %p, i64 %inc - store i64 0, i64* %arrayidx - %tmp6 = load i64, i64* %p ; [#uses=1] + %arrayidx = getelementptr inbounds i64, ptr %p, i64 %inc + store i64 0, ptr %arrayidx + %tmp6 = load i64, ptr %p ; [#uses=1] %cmp = icmp slt i64 %inc, %tmp6 ; [#uses=1] br i1 %cmp, label %for.body, label %for.end @@ -229,9 +223,9 @@ for.end: ; preds = %for.body, %entry ; different loops where neither dominates the other. This used to crash ; because we expected the arguments to an AddExpr to have a strict ; dominance order. -define void @test_no_dom(double* %data) { +define void @test_no_dom(ptr %data) { entry: - load double, double* %data + load double, ptr %data br label %for.body for.body: @@ -242,16 +236,16 @@ for.body: subloop1: %iv1 = phi i32 [0, %for.body], [%iv1.next, %subloop1] %iv1.next = add i32 %iv1, 1 - %addr1 = getelementptr double, double* %data, i32 %iv1 - store double 0.0, double* %addr1 + %addr1 = getelementptr double, ptr %data, i32 %iv1 + store double 0.0, ptr %addr1 %cmp1 = icmp slt i32 %iv1, 200 br i1 %cmp1, label %subloop1, label %for.latch subloop2: %iv2 = phi i32 [400, %for.body], [%iv2.next, %subloop2] %iv2.next = add i32 %iv2, 1 - %addr2 = getelementptr double, double* %data, i32 %iv2 - store double 0.0, double* %addr2 + %addr2 = getelementptr double, ptr %data, i32 %iv2 + store double 0.0, ptr %addr2 %cmp2 = icmp slt i32 %iv2, 600 br i1 %cmp2, label %subloop2, label %for.latch @@ -262,7 +256,7 @@ for.end: ret void } -declare double* @get_addr(i32 %i) +declare ptr @get_addr(i32 %i) ; CHECK-LABEL: Function: test_no_dom2: 3 pointers, 2 call sites ; CHECK: MayAlias: double* %addr1, double* %data @@ -272,9 +266,9 @@ declare double* @get_addr(i32 %i) ; In this case, checking %addr1 and %add2 involves two addrecs in two ; different loops where neither dominates the other. This is analogous ; to test_no_dom, but involves SCEVUnknown as opposed to SCEVAddRecExpr. -define void @test_no_dom2(double* %data) { +define void @test_no_dom2(ptr %data) { entry: - load double, double* %data + load double, ptr %data br label %for.body for.body: @@ -285,16 +279,16 @@ for.body: subloop1: %iv1 = phi i32 [0, %for.body], [%iv1.next, %subloop1] %iv1.next = add i32 %iv1, 1 - %addr1 = call double* @get_addr(i32 %iv1) - store double 0.0, double* %addr1 + %addr1 = call ptr @get_addr(i32 %iv1) + store double 0.0, ptr %addr1 %cmp1 = icmp slt i32 %iv1, 200 br i1 %cmp1, label %subloop1, label %for.latch subloop2: %iv2 = phi i32 [400, %for.body], [%iv2.next, %subloop2] %iv2.next = add i32 %iv2, 1 - %addr2 = call double* @get_addr(i32 %iv2) - store double 0.0, double* %addr2 + %addr2 = call ptr @get_addr(i32 %iv2) + store double 0.0, ptr %addr2 %cmp2 = icmp slt i32 %iv2, 600 br i1 %cmp2, label %subloop2, label %for.latch @@ -314,9 +308,9 @@ for.end: ; This is a variant of test_non_dom where the second subloop is ; dominated by the first. As a result of that, we can nest the ; addrecs and cancel out the %data base pointer. -define void @test_dom(double* %data) { +define void @test_dom(ptr %data) { entry: - load double, double* %data + load double, ptr %data br label %for.body for.body: @@ -327,16 +321,16 @@ for.body: subloop1: %iv1 = phi i32 [0, %for.body], [%iv1.next, %subloop1] %iv1.next = add i32 %iv1, 1 - %addr1 = getelementptr double, double* %data, i32 %iv1 - store double 0.0, double* %addr1 + %addr1 = getelementptr double, ptr %data, i32 %iv1 + store double 0.0, ptr %addr1 %cmp1 = icmp slt i32 %iv1, 200 br i1 %cmp1, label %subloop1, label %subloop2 subloop2: %iv2 = phi i32 [400, %subloop1], [%iv2.next, %subloop2] %iv2.next = add i32 %iv2, 1 - %addr2 = getelementptr double, double* %data, i32 %iv2 - store double 0.0, double* %addr2 + %addr2 = getelementptr double, ptr %data, i32 %iv2 + store double 0.0, ptr %addr2 %cmp2 = icmp slt i32 %iv2, 600 br i1 %cmp2, label %subloop2, label %for.latch diff --git a/llvm/test/Analysis/ScalarEvolution/scev-expander-reuse-gep.ll b/llvm/test/Analysis/ScalarEvolution/scev-expander-reuse-gep.ll index fd47b08..bea8559 100644 --- a/llvm/test/Analysis/ScalarEvolution/scev-expander-reuse-gep.ll +++ b/llvm/test/Analysis/ScalarEvolution/scev-expander-reuse-gep.ll @@ -2,8 +2,8 @@ ; in ValueOffsetPair is of pointer type. ; RUN: opt -mtriple=i386-apple-macosx10.12.0 < %s -loop-reduce -S | FileCheck %s -; CHECK: %ptr4.ptr1 = select i1 %cmp.i, i8* %ptr4, i8* %ptr1 -; CHECK-NEXT: %scevgep = getelementptr i8, i8* %ptr4.ptr1, i32 1 +; CHECK: %ptr4.ptr1 = select i1 %cmp.i, ptr %ptr4, ptr %ptr1 +; CHECK-NEXT: %uglygep = getelementptr i8, ptr %ptr4.ptr1, i32 1 ; CHECK-NEXT: br label %while.cond.i target datalayout = "e-m:o-p:32:32-f64:32:64-f80:128-n8:16:32-S128" @@ -17,17 +17,17 @@ entry: ] sw.bb28: ; preds = %entry - %0 = load i8*, i8** undef, align 2 - %ptr1 = getelementptr inbounds i8, i8* undef, i32 -1 - %ptr4 = getelementptr inbounds i8, i8* %0, i32 -1 - %cmp.i = icmp ult i8* undef, %0 - %ptr4.ptr1 = select i1 %cmp.i, i8* %ptr4, i8* %ptr1 + %0 = load ptr, ptr undef, align 2 + %ptr1 = getelementptr inbounds i8, ptr undef, i32 -1 + %ptr4 = getelementptr inbounds i8, ptr %0, i32 -1 + %cmp.i = icmp ult ptr undef, %0 + %ptr4.ptr1 = select i1 %cmp.i, ptr %ptr4, ptr %ptr1 br label %while.cond.i while.cond.i: ; preds = %while.cond.i, %sw.bb28 - %currPtr.1.i = phi i8* [ %incdec.ptr.i, %while.cond.i ], [ %ptr4.ptr1, %sw.bb28 ] - %incdec.ptr.i = getelementptr inbounds i8, i8* %currPtr.1.i, i32 1 - %1 = load i8, i8* %incdec.ptr.i, align 1 + %currPtr.1.i = phi ptr [ %incdec.ptr.i, %while.cond.i ], [ %ptr4.ptr1, %sw.bb28 ] + %incdec.ptr.i = getelementptr inbounds i8, ptr %currPtr.1.i, i32 1 + %1 = load i8, ptr %incdec.ptr.i, align 1 br label %while.cond.i sw.epilog102: ; preds = %entry diff --git a/llvm/test/Analysis/ScalarEvolution/sext-mul.ll b/llvm/test/Analysis/ScalarEvolution/sext-mul.ll index a3455aa..082e926 100644 --- a/llvm/test/Analysis/ScalarEvolution/sext-mul.ll +++ b/llvm/test/Analysis/ScalarEvolution/sext-mul.ll @@ -1,7 +1,7 @@ ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py ; RUN: opt < %s -disable-output "-passes=print" 2>&1 | FileCheck %s -define void @foo(i32* nocapture %arg, i32 %arg1, i32 %arg2) { +define void @foo(ptr nocapture %arg, i32 %arg1, i32 %arg2) { ; CHECK-LABEL: 'foo' ; CHECK-NEXT: Classifying expressions for: @foo ; CHECK-NEXT: %tmp4 = zext i32 %arg2 to i64 @@ -12,17 +12,17 @@ define void @foo(i32* nocapture %arg, i32 %arg1, i32 %arg2) { ; CHECK-NEXT: --> {0,+,8589934592}<%bb7> U: [0,-17179869183) S: [-9223372036854775808,9223372028264841217) Exits: (-8589934592 + (8589934592 * (zext i32 %arg2 to i64))) LoopDispositions: { %bb7: Computable } ; CHECK-NEXT: %tmp10 = ashr exact i64 %tmp9, 32 ; CHECK-NEXT: --> (sext i32 {0,+,2}<%bb7> to i64) U: [0,-1) S: [-2147483648,2147483647) Exits: (sext i32 (-2 + (2 * %arg2)) to i64) LoopDispositions: { %bb7: Computable } -; CHECK-NEXT: %tmp11 = getelementptr inbounds i32, i32* %arg, i64 %tmp10 +; CHECK-NEXT: %tmp11 = getelementptr inbounds i32, ptr %arg, i64 %tmp10 ; CHECK-NEXT: --> ((4 * (sext i32 {0,+,2}<%bb7> to i64)) + %arg) U: full-set S: full-set Exits: ((4 * (sext i32 (-2 + (2 * %arg2)) to i64)) + %arg) LoopDispositions: { %bb7: Computable } -; CHECK-NEXT: %tmp12 = load i32, i32* %tmp11, align 4 +; CHECK-NEXT: %tmp12 = load i32, ptr %tmp11, align 4 ; CHECK-NEXT: --> %tmp12 U: full-set S: full-set Exits: <> LoopDispositions: { %bb7: Variant } ; CHECK-NEXT: %tmp13 = sub nsw i32 %tmp12, %arg1 ; CHECK-NEXT: --> ((-1 * %arg1) + %tmp12) U: full-set S: full-set Exits: <> LoopDispositions: { %bb7: Variant } ; CHECK-NEXT: %tmp14 = or i64 %tmp10, 1 ; CHECK-NEXT: --> (1 + (sext i32 {0,+,2}<%bb7> to i64)) U: [1,0) S: [-2147483647,2147483648) Exits: (1 + (sext i32 (-2 + (2 * %arg2)) to i64)) LoopDispositions: { %bb7: Computable } -; CHECK-NEXT: %tmp15 = getelementptr inbounds i32, i32* %arg, i64 %tmp14 +; CHECK-NEXT: %tmp15 = getelementptr inbounds i32, ptr %arg, i64 %tmp14 ; CHECK-NEXT: --> (4 + (4 * (sext i32 {0,+,2}<%bb7> to i64)) + %arg) U: full-set S: full-set Exits: (4 + (4 * (sext i32 (-2 + (2 * %arg2)) to i64)) + %arg) LoopDispositions: { %bb7: Computable } -; CHECK-NEXT: %tmp16 = load i32, i32* %tmp15, align 4 +; CHECK-NEXT: %tmp16 = load i32, ptr %tmp15, align 4 ; CHECK-NEXT: --> %tmp16 U: full-set S: full-set Exits: <> LoopDispositions: { %bb7: Variant } ; CHECK-NEXT: %tmp17 = mul nsw i32 %tmp16, %arg1 ; CHECK-NEXT: --> (%arg1 * %tmp16) U: full-set S: full-set Exits: <> LoopDispositions: { %bb7: Variant } @@ -54,21 +54,21 @@ bb7: ; preds = %bb7, %bb3 %tmp8 = phi i64 [ %tmp18, %bb7 ], [ 0, %bb3 ] %tmp9 = shl i64 %tmp8, 33 %tmp10 = ashr exact i64 %tmp9, 32 - %tmp11 = getelementptr inbounds i32, i32* %arg, i64 %tmp10 - %tmp12 = load i32, i32* %tmp11, align 4 + %tmp11 = getelementptr inbounds i32, ptr %arg, i64 %tmp10 + %tmp12 = load i32, ptr %tmp11, align 4 %tmp13 = sub nsw i32 %tmp12, %arg1 - store i32 %tmp13, i32* %tmp11, align 4 + store i32 %tmp13, ptr %tmp11, align 4 %tmp14 = or i64 %tmp10, 1 - %tmp15 = getelementptr inbounds i32, i32* %arg, i64 %tmp14 - %tmp16 = load i32, i32* %tmp15, align 4 + %tmp15 = getelementptr inbounds i32, ptr %arg, i64 %tmp14 + %tmp16 = load i32, ptr %tmp15, align 4 %tmp17 = mul nsw i32 %tmp16, %arg1 - store i32 %tmp17, i32* %tmp15, align 4 + store i32 %tmp17, ptr %tmp15, align 4 %tmp18 = add nuw nsw i64 %tmp8, 1 %tmp19 = icmp eq i64 %tmp18, %tmp4 br i1 %tmp19, label %bb5, label %bb7 } -define void @goo(i32* nocapture %arg3, i32 %arg4, i32 %arg5) { +define void @goo(ptr nocapture %arg3, i32 %arg4, i32 %arg5) { ; CHECK-LABEL: 'goo' ; CHECK-NEXT: Classifying expressions for: @goo ; CHECK-NEXT: %t4 = zext i32 %arg5 to i128 @@ -79,17 +79,17 @@ define void @goo(i32* nocapture %arg3, i32 %arg4, i32 %arg5) { ; CHECK-NEXT: --> {0,+,1267650600228229401496703205376}<%bb7> U: [0,-1267650600228229401496703205375) S: [-170141183460469231731687303715884105728,170141182192818631503457902219180900353) Exits: (-1267650600228229401496703205376 + (1267650600228229401496703205376 * (zext i32 %arg5 to i128))) LoopDispositions: { %bb7: Computable } ; CHECK-NEXT: %t10 = ashr exact i128 %t9, 1 ; CHECK-NEXT: --> (sext i127 {0,+,633825300114114700748351602688}<%bb7> to i128) U: [0,-633825300114114700748351602687) S: [-85070591730234615865843651857942052864,85070591096409315751728951109590450177) Exits: (sext i127 (-633825300114114700748351602688 + (633825300114114700748351602688 * (zext i32 %arg5 to i127))) to i128) LoopDispositions: { %bb7: Computable } -; CHECK-NEXT: %t11 = getelementptr inbounds i32, i32* %arg3, i128 %t10 +; CHECK-NEXT: %t11 = getelementptr inbounds i32, ptr %arg3, i128 %t10 ; CHECK-NEXT: --> %arg3 U: full-set S: full-set Exits: %arg3 LoopDispositions: { %bb7: Invariant } -; CHECK-NEXT: %t12 = load i32, i32* %t11, align 4 +; CHECK-NEXT: %t12 = load i32, ptr %t11, align 4 ; CHECK-NEXT: --> %t12 U: full-set S: full-set Exits: <> LoopDispositions: { %bb7: Variant } ; CHECK-NEXT: %t13 = sub nsw i32 %t12, %arg4 ; CHECK-NEXT: --> ((-1 * %arg4) + %t12) U: full-set S: full-set Exits: <> LoopDispositions: { %bb7: Variant } ; CHECK-NEXT: %t14 = or i128 %t10, 1 ; CHECK-NEXT: --> (1 + (sext i127 {0,+,633825300114114700748351602688}<%bb7> to i128)) U: [1,-633825300114114700748351602686) S: [-85070591730234615865843651857942052863,85070591096409315751728951109590450178) Exits: (1 + (sext i127 (-633825300114114700748351602688 + (633825300114114700748351602688 * (zext i32 %arg5 to i127))) to i128)) LoopDispositions: { %bb7: Computable } -; CHECK-NEXT: %t15 = getelementptr inbounds i32, i32* %arg3, i128 %t14 +; CHECK-NEXT: %t15 = getelementptr inbounds i32, ptr %arg3, i128 %t14 ; CHECK-NEXT: --> (4 + %arg3) U: [4,0) S: [4,0) Exits: (4 + %arg3) LoopDispositions: { %bb7: Invariant } -; CHECK-NEXT: %t16 = load i32, i32* %t15, align 4 +; CHECK-NEXT: %t16 = load i32, ptr %t15, align 4 ; CHECK-NEXT: --> %t16 U: full-set S: full-set Exits: <> LoopDispositions: { %bb7: Variant } ; CHECK-NEXT: %t17 = mul nsw i32 %t16, %arg4 ; CHECK-NEXT: --> (%arg4 * %t16) U: full-set S: full-set Exits: <> LoopDispositions: { %bb7: Variant } @@ -121,15 +121,15 @@ bb7: ; preds = %bb7, %bb3 %t8 = phi i128 [ %t18, %bb7 ], [ 0, %bb3 ] %t9 = shl i128 %t8, 100 %t10 = ashr exact i128 %t9, 1 - %t11 = getelementptr inbounds i32, i32* %arg3, i128 %t10 - %t12 = load i32, i32* %t11, align 4 + %t11 = getelementptr inbounds i32, ptr %arg3, i128 %t10 + %t12 = load i32, ptr %t11, align 4 %t13 = sub nsw i32 %t12, %arg4 - store i32 %t13, i32* %t11, align 4 + store i32 %t13, ptr %t11, align 4 %t14 = or i128 %t10, 1 - %t15 = getelementptr inbounds i32, i32* %arg3, i128 %t14 - %t16 = load i32, i32* %t15, align 4 + %t15 = getelementptr inbounds i32, ptr %arg3, i128 %t14 + %t16 = load i32, ptr %t15, align 4 %t17 = mul nsw i32 %t16, %arg4 - store i32 %t17, i32* %t15, align 4 + store i32 %t17, ptr %t15, align 4 %t18 = add nuw nsw i128 %t8, 1 %t19 = icmp eq i128 %t18, %t4 br i1 %t19, label %bb5, label %bb7 -- 2.7.4