[llvm] [ValueTracking] Add support for `usub.sat` in `isKnownNonZero (PR #87700)
Yingwei Zheng via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 8 03:10:48 PDT 2024
================
@@ -882,11 +882,7 @@ define i1 @usub_sat_nonzero(i8 %xx, i8 %yy, i8 %ind) {
; CHECK-LABEL: @usub_sat_nonzero(
; CHECK-NEXT: [[Y_ULT_31:%.*]] = icmp ult i8 [[YY:%.*]], 31
; CHECK-NEXT: call void @llvm.assume(i1 [[Y_ULT_31]])
-; CHECK-NEXT: [[XO:%.*]] = or i8 [[XX:%.*]], 34
----------------
dtcxzyw wrote:
It has been handled in InstCombine by converting the `usub.sat` into `sub nuw`: https://godbolt.org/z/he76W3K3v
I think this patch just duplicates the logic in InstCombine: https://github.com/llvm/llvm-project/blob/8461d901a770516cf2069fe3bce979a6f8fc8d76/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp#L2150-L2160
https://github.com/llvm/llvm-project/pull/87700
More information about the llvm-commits
mailing list