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 narrow expr if trunc cannot be removed.
Narrowing an input expression of a truncate to a type larger than the result of the truncate won't allow removing the truncate, but it may enable further optimizations, e.g. allowing for larger vectorization factors. For now this is intentionally limited to integer types only, to avoid producing new vector ops that might not be suitable for the target. If we know that the only user is a trunc, we can also be allow more cases, e.g. also shortening expressions with some additional shifts. I would appreciate feedback on the best place to do such a narrowing. This fixes PR43580. Reviewers: spatel, RKSimon, lebedev.ri, xbolva00 Reviewed By: lebedev.ri Differential Revision: https://reviews.llvm.org/D82973
- Loading branch information
Showing
2 changed files
with
34 additions
and
15 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