[PATCH] D117670: [RISCV] Support matching 'VF' VL patterns via SPLAT_VECTOR

Fraser Cormack via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 27 06:44:21 PST 2022


frasercrmck added inline comments.
Herald added a subscriber: pcwang-thead.


================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td:261
 // Ignore the vl operand.
 def SplatFPOp : PatFrag<(ops node:$op),
                         (riscv_vfmv_v_f_vl node:$op, srcvalue)>;
----------------
craig.topper wrote:
> frasercrmck wrote:
> > There's still one use of this to match `VSELECT_VL` with `fpimm0`. Is there a way to use `SplatFPPat` but ensure it matches only `fpimm0`? Must it be its own `ComplexPattern`?
> I can't think of any way to do it. You could inline this into the one use and add the second pattern for the other case. Then we don't have a single use complex pattern. That's a larger generated table size for two patterns for every FP type, but maybe a drop in the bucket compared to the size of the whole table.
Just so I'm sure, your comment about a larger generated table size applies only to this `fpimm0` section because we'd have two `riscv_vselect_vl` patterns with `splat_vector` and `riscv_vfmv_v_f_vl`? The use of the new `ComplexPattern` elsewhere doesn't increase the table size, unless it's a root?

If that's the case, yeah it's a definitely a shame but perhaps not a big deal, as you say. I can check the differences.

A thought occurs - how feasible is it to preprocess the DAG to turn floating-point `splat_vector`s into `riscv_vfmv_v_f_vl`? Then we just need the one pattern everywhere. I'm assuming we don't want to do custom lowering or else we'd already be doing it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D117670



More information about the llvm-commits mailing list