llvm-project
fe105347 - [SelectionDAG] Expand CTTZ_ELTS[_ZERO_POISON] and handle splitting (#185605)

Commit
6 days ago
[SelectionDAG] Expand CTTZ_ELTS[_ZERO_POISON] and handle splitting (#185605) Currently a cttz.elts of e.g. nxv32i1 will get expanded to a reduction of nxv32i64 or equivalent, but we can split it into two legal nxv16i1 cttz.elts once we have dedicated SelectionDAG nodes. This implements the splitting for them the same way we implement type splitting for vp.cttz.elts, i.e. check if the low result is VF, and if so add it to the result of the high result. It also implements operand type promotion for NEON which needs to promote i1 vectors to something larger first. We also need to move expansion into LegalizeVectorOps so it doesn't get expanded before type legalization can do splitting. This uses LegalizeVectorOps in case the scalar reduction type, which depends on the minimum bitwidth needed to store the result, still needs type promotion. The TTI costs should be updated after this to reflect the more efficient codegen, but that is deferred to another PR.
Author
Parents
Loading