diff options
author | Sanjay Patel <spatel@rotateright.com> | 2022-12-01 14:17:07 -0500 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2022-12-01 14:47:37 -0500 |
commit | dd8d0d21ce6d0665ef5d426372096aaed85b479a (patch) | |
tree | dcf74d559e3496d5c498877b18d157fec0a30be5 /llvm/unittests/Support/MathExtrasTest.cpp | |
parent | b7c7fe3d0779b6e332fe6db64e87561deba2e56a (diff) | |
download | llvm-dd8d0d21ce6d0665ef5d426372096aaed85b479a.zip llvm-dd8d0d21ce6d0665ef5d426372096aaed85b479a.tar.gz llvm-dd8d0d21ce6d0665ef5d426372096aaed85b479a.tar.bz2 |
[InstCombine] canonicalize trunc + insert as bitcast + shuffle, part 2
This enhances the base fold from part 1 to allow mapping a
right-shift to an insert index.
Example of translating a middle chunk of the scalar to vector
for either endian:
https://alive2.llvm.org/ce/z/fRXCOZ
This only allows creating an identity shuffle (with optional
shortening/lengthening) because that is considered the safe
baseline for any target (can be inverted if needed). If we
tried this fold with target-specific costs/legality, then we
could do the transform more generally.
Differential Revision: https://reviews.llvm.org/D138873
Diffstat (limited to 'llvm/unittests/Support/MathExtrasTest.cpp')
0 files changed, 0 insertions, 0 deletions