Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[InstCombine] try to fold div with constant dividend and select-of-co…
…nstants divisor We avoid this fold in the more general cases where we use FoldOpIntoSelect. That's because -- unlike most binary opcodes -- 'div' can't usually be speculated with a variable divisor since it can have immediate UB. But in the case where both arms of the select are constants, we can safely evaluate both sides and eliminate 'div' completely. This is a follow-up to the equivalent fold for 'rem' opcodes: D115173 / f65be72
- Loading branch information
1 parent
2676759
commit a7ed21a
Showing
2 changed files
with
41 additions
and
12 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