-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[MLIR][Arith] SelectOp fix invalid folding #117555
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 |
|---|---|---|
|
|
@@ -2314,7 +2314,8 @@ OpFoldResult arith::SelectOp::fold(FoldAdaptor adaptor) { | |
| return trueVal; | ||
|
|
||
| // select %x, true, false => %x | ||
| if (getType().isInteger(1) && matchPattern(adaptor.getTrueValue(), m_One()) && | ||
| if (getType().isSignlessInteger(1) && | ||
| matchPattern(adaptor.getTrueValue(), m_One()) && | ||
| matchPattern(adaptor.getFalseValue(), m_Zero())) | ||
| return condition; | ||
|
Member
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. I think we could also have a canon pattern that can broadcast the condition in the vector case, but that's probably better for a separate PR.
Contributor
Author
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. Since I am not familiar with the Arith + vector use case, I would prefer a separate PR for this. |
||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.