aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/Analysis
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2023-12-18 09:58:23 +0100
committerNikita Popov <npopov@redhat.com>2023-12-18 12:26:40 +0100
commit337504683efa0b898bcf69b4e5be67d73dbaf180 (patch)
treec21b52dda1390bc710650959d00444f823c9206a /llvm/test/Analysis
parent7c1d8c74e8576c12da526f589c802faa91bc410a (diff)
downloadllvm-337504683efa0b898bcf69b4e5be67d73dbaf180.zip
llvm-337504683efa0b898bcf69b4e5be67d73dbaf180.tar.gz
llvm-337504683efa0b898bcf69b4e5be67d73dbaf180.tar.bz2
[ValueTracking] Use isKnownNonEqual() in isNonZeroSub()
(x - y) != 0 is true iff x != y, so use the isKnownNonEqual() helper, which knows some additional tricks.
Diffstat (limited to 'llvm/test/Analysis')
-rw-r--r--llvm/test/Analysis/ValueTracking/known-non-zero.ll5
1 files changed, 1 insertions, 4 deletions
diff --git a/llvm/test/Analysis/ValueTracking/known-non-zero.ll b/llvm/test/Analysis/ValueTracking/known-non-zero.ll
index d8dbd1a..c8e17f8 100644
--- a/llvm/test/Analysis/ValueTracking/known-non-zero.ll
+++ b/llvm/test/Analysis/ValueTracking/known-non-zero.ll
@@ -1222,10 +1222,7 @@ define i1 @sub_via_non_eq(i8 %x, i8 %y) {
; CHECK-LABEL: @sub_via_non_eq(
; CHECK-NEXT: [[NE:%.*]] = icmp ne i8 [[X:%.*]], 0
; CHECK-NEXT: call void @llvm.assume(i1 [[NE]])
-; CHECK-NEXT: [[SHL:%.*]] = shl nuw i8 [[X]], 3
-; CHECK-NEXT: [[SUB:%.*]] = sub i8 [[X]], [[SHL]]
-; CHECK-NEXT: [[CMP:%.*]] = icmp eq i8 [[SUB]], 0
-; CHECK-NEXT: ret i1 [[CMP]]
+; CHECK-NEXT: ret i1 false
;
%ne = icmp ne i8 %x, 0
call void @llvm.assume(i1 %ne)