simplify i1 comparisons against boolean constants (#1417)#2548
simplify i1 comparisons against boolean constants (#1417)#2548shema-boris wants to merge 5 commits into
Conversation
wsmoses
left a comment
There was a problem hiding this comment.
looks good, can you also add it to the transform dialect registration [see the dev docs for info]?
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2548 +/- ##
==========================================
+ Coverage 25.67% 28.62% +2.95%
==========================================
Files 221 225 +4
Lines 44799 44316 -483
==========================================
+ Hits 11502 12686 +1184
+ Misses 33297 31630 -1667 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@wsmoses , I added it!! |
|
clang-format ci fails |
|
I can work on that as well, let me run the clang-format on fomatted lines and push a fix shortly |
|
@wsmoses Clang-Format was successful |
wsmoses
left a comment
There was a problem hiding this comment.
sorry one more thing:
can you add the newly added pattern to:
also compare_ext is missing, we should add that there too
|
Registered both of them. |
|
@wsmoses Is there anything else I should do? I have added all the patterns to EnzymeXLA.cpp |
Summary
Adds a
CompareBoolConstsimplification to--enzyme-hlo-optso thatcomparisons of an
i1(boolean) tensor against a boolean constant are foldedaway. Fixes #1417 .
Problem
For boolean tensors,
enzyme-hlo-optleft redundant comparisons in the IR. Themotivating case from the issue: