-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[ValueTracking] Add support for usub.sat
in `isKnownNonZero
#87700
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -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 | ||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It has been handled in InstCombine by converting the I think this patch just duplicates the logic in InstCombine: llvm-project/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp Lines 2150 to 2160 in 8461d90
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah yes, good point. Actually, now that you mention it, I'm pretty sure that @goldsteinn already submitted a patch along these lines on phabricator and we reached the same conclusion there... Maybe we should leave a comment so we don't get a third implementation :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are right, I forgot :) I'll close this and push a comment |
||||||||||||||||||||||||
; CHECK-NEXT: [[X:%.*]] = call i8 @llvm.usub.sat.i8(i8 [[XO]], i8 [[YY]]) | ||||||||||||||||||||||||
; 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 | ||||||||||||||||||||||||
; | ||||||||||||||||||||||||
%y_ult_31 = icmp ult i8 %yy, 31 | ||||||||||||||||||||||||
call void @llvm.assume(i1 %y_ult_31) | ||||||||||||||||||||||||
|
Uh oh!
There was an error while loading. Please reload this page.