[PATCH] D95833: [RISCV] Replace NoX0 SDNodeXForm with a ComplexPattern to do the selection of the VL operand.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 1 23:52:25 PST 2021


craig.topper added a comment.

In D95833#2535754 <https://reviews.llvm.org/D95833#2535754>, @rogfer01 wrote:

> I admit that I initially wasn't convinced by the idea of `ComplexPattern` including both the matching logic (which is only `return true`) and a bit of selection logic (`selectImm`) in the input DAG. But on a second thought this allows the two logics be kept together.
>
> Also if this is the common way to do this then we better use existing idioms. To be fair that `undef` in the `SDNodeXForm` has always looked a bit off to me.
>
> Thanks for the cleanup @craig.topper

Yeah the `undef` looked off to me too.

I'm now wondering if we could extend this further and emit the vsetvli from inside here. If remove the explicit VL and SEWs operands from m the instructions, we might be able to attach the implicit VL physical register def from the vsetvli directly to the implicit physical register use in the instruction. We'd probably need multiple complex patterns to templatize the SEW value and tail policy. The main advantage of this is it might allow us to more directly match the new vsetivli instruction rather than going digging for the immediate from the ADDI instruction in the custom inserter.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95833



More information about the llvm-commits mailing list