[PATCH] D149411: [ValueTracking] Add logic for `isKnownNonZero(sshl.sat/ushl.sat X, Y)`
Noah Goldstein via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Apr 30 08:07:36 PDT 2023
This revision was automatically updated to reflect the committed changes.
Closed by commit rGf1dfa4938a2f: [ValueTracking] Add logic for `isKnownNonZero(sshl.sat/ushl.sat X, Y)` (authored by goldstein.w.n).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D149411/new/
https://reviews.llvm.org/D149411
Files:
llvm/lib/Analysis/ValueTracking.cpp
llvm/test/Analysis/ValueTracking/known-non-zero.ll
Index: llvm/test/Analysis/ValueTracking/known-non-zero.ll
===================================================================
--- llvm/test/Analysis/ValueTracking/known-non-zero.ll
+++ llvm/test/Analysis/ValueTracking/known-non-zero.ll
@@ -803,10 +803,7 @@
; CHECK-LABEL: @sshl_nonzero(
; CHECK-NEXT: [[X_NZ:%.*]] = icmp ne i8 [[XX:%.*]], 0
; CHECK-NEXT: call void @llvm.assume(i1 [[X_NZ]])
-; CHECK-NEXT: [[X:%.*]] = call i8 @llvm.sshl.sat.i8(i8 [[XX]], i8 [[Y:%.*]])
-; CHECK-NEXT: [[Z:%.*]] = or i8 [[X]], [[IND:%.*]]
-; CHECK-NEXT: [[R:%.*]] = icmp eq i8 [[Z]], 0
-; CHECK-NEXT: ret i1 [[R]]
+; CHECK-NEXT: ret i1 false
;
%x_nz = icmp ne i8 %xx, 0
call void @llvm.assume(i1 %x_nz)
@@ -833,10 +830,7 @@
; CHECK-LABEL: @ushl_nonzero(
; CHECK-NEXT: [[X_NZ:%.*]] = icmp ne i8 [[XX:%.*]], 0
; CHECK-NEXT: call void @llvm.assume(i1 [[X_NZ]])
-; CHECK-NEXT: [[X:%.*]] = call i8 @llvm.ushl.sat.i8(i8 [[XX]], i8 [[Y:%.*]])
-; CHECK-NEXT: [[Z:%.*]] = or i8 [[X]], [[IND:%.*]]
-; CHECK-NEXT: [[R:%.*]] = icmp eq i8 [[Z]], 0
-; CHECK-NEXT: ret i1 [[R]]
+; CHECK-NEXT: ret i1 false
;
%x_nz = icmp ne i8 %xx, 0
call void @llvm.assume(i1 %x_nz)
Index: llvm/lib/Analysis/ValueTracking.cpp
===================================================================
--- llvm/lib/Analysis/ValueTracking.cpp
+++ llvm/lib/Analysis/ValueTracking.cpp
@@ -2920,6 +2920,8 @@
case Instruction::Call:
if (auto *II = dyn_cast<IntrinsicInst>(I)) {
switch (II->getIntrinsicID()) {
+ case Intrinsic::sshl_sat:
+ case Intrinsic::ushl_sat:
case Intrinsic::abs:
case Intrinsic::bitreverse:
case Intrinsic::bswap:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149411.518321.patch
Type: text/x-patch
Size: 1684 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230430/2d1865db/attachment.bin>
More information about the llvm-commits
mailing list