[PATCH] D122563: [RISCV] Add DAGCombine to fold base operation and reduction.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 7 21:51:03 PDT 2022


craig.topper added a comment.

In D122563#3415868 <https://reviews.llvm.org/D122563#3415868>, @frasercrmck wrote:

> Taking a step back a bit, this is also a target-independent combine we'd want to perform on `vp.reduce` operations, right? Is it possible that we may want to lower/combine `vector.reduce` to `vp.reduce` and let this sort of combine happen in a target-independent combine?

I think that makes sense, but I have a few questions.

-Do we currently mark VP_REDUCE nodes as Expand on targets that don't support it? I don't see anything in TargetLoweringBase::initActions, but maybe I missed it. I think we would need that fixed to know if we could do the combine so that we only do it on targets that support it.
-What would we use for VL for the VP_REDUCE from a generic combine? vscale * known minimum element count? Then we'd need to detect that and replace it with RISCV::X0 for RISCV?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122563/new/

https://reviews.llvm.org/D122563



More information about the llvm-commits mailing list