diff options
author | Florian Mayer <fmayer@google.com> | 2025-09-24 12:10:02 -0700 |
---|---|---|
committer | Florian Mayer <fmayer@google.com> | 2025-09-24 12:10:02 -0700 |
commit | b429c6531006928822b314b0099266c01ea24d16 (patch) | |
tree | 83fde4a315f397a7a9f9d1ee40e6361d2c4dc531 | |
parent | a5934f6b401ce3cee936438db173c7fc676cece2 (diff) | |
download | llvm-users/fmayer/spr/nfc-indvarsimplify-add-overflowing-tests.zip llvm-users/fmayer/spr/nfc-indvarsimplify-add-overflowing-tests.tar.gz llvm-users/fmayer/spr/nfc-indvarsimplify-add-overflowing-tests.tar.bz2 |
Created using spr 1.3.4
-rw-r--r-- | llvm/test/Transforms/IndVarSimplify/X86/overflow-intrinsics.ll | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/test/Transforms/IndVarSimplify/X86/overflow-intrinsics.ll b/llvm/test/Transforms/IndVarSimplify/X86/overflow-intrinsics.ll index eda7e0c..cb4e07e 100644 --- a/llvm/test/Transforms/IndVarSimplify/X86/overflow-intrinsics.ll +++ b/llvm/test/Transforms/IndVarSimplify/X86/overflow-intrinsics.ll @@ -229,6 +229,9 @@ cont: ; preds = %for.body br i1 %cmp, label %for.body, label %for.cond.cleanup } +; It is theoretically possible to replace the `ssub.with.overflow` with a +; condition on the IV, but SCEV cannot represent non-unsigned-wrapping +; subtraction operations. define void @f_ssub_overflow(ptr nocapture %a) { ; CHECK-LABEL: define void @f_ssub_overflow( ; CHECK-SAME: ptr captures(none) [[A:%.*]]) { @@ -322,6 +325,9 @@ cont: ; preds = %for.body br i1 %cmp, label %for.body, label %for.cond.cleanup } +; It is theoretically possible to replace the `usub.with.overflow` with a +; condition on the IV, but SCEV cannot represent non-unsigned-wrapping +; subtraction operations. define void @f_usub_overflow(ptr nocapture %a) { ; CHECK-LABEL: define void @f_usub_overflow( ; CHECK-SAME: ptr captures(none) [[A:%.*]]) { @@ -357,10 +363,6 @@ for.body: ; preds = %entry, %cont store i8 0, ptr %arrayidx, align 1 %0 = tail call { i32, i1 } @llvm.usub.with.overflow.i32(i32 %i.04, i32 1) %1 = extractvalue { i32, i1 } %0, 1 - -; It is theoretically possible to prove this, but SCEV cannot -; represent non-unsigned-wrapping subtraction operations. - br i1 %1, label %trap, label %cont, !nosanitize !{} trap: ; preds = %for.body |