-
Notifications
You must be signed in to change notification settings - Fork 434
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR #14073: Add select(compare(a, b, GT/GE), a, b) => or(a, b) to algsimp
Imported from GitHub PR #14073 In one of the customer's HLOs (in the reduceOp computation function), I found the following pattern: ```c p0 = pred[]{0} parameter(0) p1 = pred[]{0} parameter(1) compare = pred[]{0} compare(p0, p1), direction=GT select = pred[]{0} select(compare, p0, p1) ``` It can be simplified to `logical_or`. This PR adds the following patterns to algsimp ```c select(compare(a, b, GT/GE), a, b) => or(a, b) select(compare(a, b, LT/LE), a, b) => and(a, b) select(compare(a, b, EQ), a, b) => b select(compare(a, b, NE), a, b) => a a,b ∈ PRED ``` Copybara import of the project: -- 6fe68d7 by Alexander Pivovarov <[email protected]>: Add select(compare(a, b, GT/GE), a, b) => or(a, b) to algsimp Merging this change closes #14073 COPYBARA_INTEGRATE_REVIEW=#14073 from apivovarov:select_compare_algsimp 6fe68d7 PiperOrigin-RevId: 646667024
- Loading branch information
1 parent
6fdb791
commit 6a009c8
Showing
2 changed files
with
116 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters