[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
Loading
Please sign in to comment