Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[InstCombine] generalize subtract with 'not' operands; 2nd try
This is a re-try of 3aa009c which was reverted at 9577fac because it caused an infinite loop. For the extra test case, either re-ordering the transforms or adding the extra clause to avoid sub-of-sub is enough to prevent the infinite compile, but I'm doing both to be safer. Original commit message: The motivation was to get min/max intrinsics to parity with cmp+select idioms, but this unlocks a few more folds because isFreeToInvert recognizes add/sub with constants too. In the min/max example, we have too many extra uses for smaller folds to improve things, but this fold is able to eliminate uses even though we can't reduce the number of instructions.
- Loading branch information
1 parent
ba6e15d
commit cc9c545
Showing
4 changed files
with
18 additions
and
17 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
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