llvm-project
367569e6 - [SelectionDAG] Use ExpandIntRes_CLMUL to expand vector CLMUL via narrower legal types (#184468)

Commit
34 days ago
[SelectionDAG] Use ExpandIntRes_CLMUL to expand vector CLMUL via narrower legal types (#184468) Reuse the ExpandIntRes_CLMUL identity to expand vector CLMUL/CLMULR/CLMULH on wider element types (vXi16, vXi32, vXi64) by decomposing into half-element-width operations that eventually reach a legal CLMUL type. Three generic strategies in expandCLMUL: 1. Halve: halve element width (e.g. v8i16 -> v8i8 on AArch64) 2. promote to double : zext to wider type if CLMUL is legal there (e.g. x86) 3. Count widen: pad with undef to double element count (e.g. v4i16 -> v8i16) A helper canNarrowCLMULToLegal() guides strategy selection and prevents circular expansion in the CLMULH bitreverse path. Also add Custom BITREVERSE lowering for v4i16/v8i16 on AArch64 using REV16+RBIT, which the CLMULH expansion relies on. Fixes #183768
Parents
Loading