llvm-project
379646c8 - [InstCombine] Skip extelt-trunc bitcast fold for non-power-of-2 element sizes (#242998)

Commit
14 hours ago
[InstCombine] Skip extelt-trunc bitcast fold for non-power-of-2 element sizes (#242998) `foldVecExtTruncToExtElt()` turns trunc(extractelement) into bitcast + extractelement. For vectors with a non-power-of-2 element size this creates bitcasts like ``` bitcast <vscale x 4 x i56> to <vscale x 56 x i4> ``` which the backend cannot legalize, so RISC-V crashes in WidenVecRes_BITCAST. For fixed vectors the bitcast is legalizable, but the backend has to emulate it through memory, which costs more than the scalar trunc. Skip the fold for non-power-of-2 element sizes, for both fixed and scalable vectors. Fixes #242247 Assisted-by: TRAE CLI (GLM-5.4)
Author
Parents
Loading