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