[llvm] 0375734 - [NFC] Add extra test for D106331
Eli Friedman via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 8 14:19:20 PDT 2021
Author: Eli Friedman
Date: 2021-09-08T14:18:47-07:00
New Revision: 0375734439a0eaeab76a48eff6ef974017bbf4fe
URL: https://github.com/llvm/llvm-project/commit/0375734439a0eaeab76a48eff6ef974017bbf4fe
DIFF: https://github.com/llvm/llvm-project/commit/0375734439a0eaeab76a48eff6ef974017bbf4fe.diff
LOG: [NFC] Add extra test for D106331
Added:
Modified:
llvm/test/Analysis/ScalarEvolution/no-wrap-symbolic-becount.ll
Removed:
################################################################################
diff --git a/llvm/test/Analysis/ScalarEvolution/no-wrap-symbolic-becount.ll b/llvm/test/Analysis/ScalarEvolution/no-wrap-symbolic-becount.ll
index 61ac15aabf7e..e04cb652a0c7 100644
--- a/llvm/test/Analysis/ScalarEvolution/no-wrap-symbolic-becount.ll
+++ b/llvm/test/Analysis/ScalarEvolution/no-wrap-symbolic-becount.ll
@@ -1,5 +1,5 @@
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
-; RUN: opt < %s -S -scalar-evolution-use-expensive-range-sharpening -passes='print<scalar-evolution>' 2>&1 | FileCheck %s
+; RUN: opt < %s -disable-output -scalar-evolution-use-expensive-range-sharpening -passes='print<scalar-evolution>' 2>&1 | FileCheck %s
define i32 @test_01(i32 %start, i32* %p, i32* %q) {
; CHECK-LABEL: 'test_01'
@@ -121,7 +121,33 @@ end:
ret void
}
-define i32 @dummy(i32 %start, i32* %p, i32* %q) {
+define void @pointer_iv_nowrap_guard(i32* %startptr, i32* %endptr) local_unnamed_addr {
+; CHECK-LABEL: 'pointer_iv_nowrap_guard'
+; CHECK-NEXT: Classifying expressions for: @pointer_iv_nowrap_guard
+; CHECK-NEXT: %init = getelementptr inbounds i32, i32* %startptr, i64 2000
+; CHECK-NEXT: --> (8000 + %startptr)<nuw> U: [8000,0) S: [8000,0)
+; CHECK-NEXT: %iv = phi i32* [ %init, %entry ], [ %iv.next, %loop ]
+; CHECK-NEXT: --> {(8000 + %startptr)<nuw>,+,4}<nuw><%loop> U: [8000,0) S: [8000,0) Exits: (8000 + (4 * ((-8001 + (-1 * (ptrtoint i32* %startptr to i64)) + ((8004 + (ptrtoint i32* %startptr to i64))<nuw> umax (ptrtoint i32* %endptr to i64))) /u 4))<nuw> + %startptr) LoopDispositions: { %loop: Computable }
+; CHECK-NEXT: %iv.next = getelementptr inbounds i32, i32* %iv, i64 1
+; CHECK-NEXT: --> {(8004 + %startptr)<nuw>,+,4}<nuw><%loop> U: [8004,0) S: [8004,0) Exits: (8004 + (4 * ((-8001 + (-1 * (ptrtoint i32* %startptr to i64)) + ((8004 + (ptrtoint i32* %startptr to i64))<nuw> umax (ptrtoint i32* %endptr to i64))) /u 4))<nuw> + %startptr) LoopDispositions: { %loop: Computable }
+; CHECK-NEXT: Determining loop execution counts for: @pointer_iv_nowrap_guard
+; CHECK-NEXT: Loop %loop: backedge-taken count is ((-8001 + (-1 * (ptrtoint i32* %startptr to i64)) + ((8004 + (ptrtoint i32* %startptr to i64))<nuw> umax (ptrtoint i32* %endptr to i64))) /u 4)
+; CHECK-NEXT: Loop %loop: max backedge-taken count is 4611686018427385902
+; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is ((-8001 + (-1 * (ptrtoint i32* %startptr to i64)) + ((8004 + (ptrtoint i32* %startptr to i64))<nuw> umax (ptrtoint i32* %endptr to i64))) /u 4)
+; CHECK-NEXT: Predicates:
+; CHECK: Loop %loop: Trip multiple is 1
+;
entry:
- ret i32 0
+ %init = getelementptr inbounds i32, i32* %startptr, i64 2000
+ %cmp2 = icmp ult i32* %init, %endptr
+ br i1 %cmp2, label %loop, label %end
+
+loop:
+ %iv = phi i32* [ %init, %entry ], [ %iv.next, %loop ]
+ %iv.next = getelementptr inbounds i32, i32* %iv, i64 1
+ %ec = icmp uge i32* %iv.next, %endptr
+ br i1 %ec, label %end, label %loop
+
+end:
+ ret void
}
More information about the llvm-commits
mailing list