Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[InstCombine] ease restriction for extractelt (bitcast X) fold
We were checking for a desirable integer type even when there is no shift in the transform. This is unnecessary since we are truncating directly to the destination type. This removes an extractelt in more cases and seems to make the canonicalization more uniform overall. There's still a potential difference between patterns that need a shift vs. trunc-only. I'm not sure if that is worth keeping at this point, but it can be adjusted in another step (assuming this change does not cause trouble). In the most basic case where I noticed this, we missed a fold that would have completely removed vector ops from a pattern like: https://alive2.llvm.org/ce/z/y4Qdte
- Loading branch information
1 parent
5cf75ec
commit 535c5d5
Showing
4 changed files
with
95 additions
and
109 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