[PATCH] D93312: [RISCV] Add ISel support for RVV .vx and .vi forms

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 18 12:00:32 PST 2020


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td:636
+let Complexity = 1 in
+def SplatPat       : ComplexPattern<vAny, 1, "SelectVSplat", [splat_vector, rv32_splat_i64]>;
+def SplatPat_simm5 : ComplexPattern<vAny, 1, "SelectVSplat_simm5", [splat_vector, rv32_splat_i64]>;
----------------
frasercrmck wrote:
> craig.topper wrote:
> > I don't think you want anything in the square brackets. That autogenerates a pattern for splat_vector/rv32_splat_i64 as the root node for the isel match. I guess your vmv.v.v pattern is getting priority so its not causing a problem?
> I'm not sure I follow, sorry. I think I'll need to read up on `ComplexPattern`s as I've managed to avoid them thus far.
The list in square brackets is not used when the ComplexPattern is used as an operand of another node. That's why you have to check for the opcode in the C++.

The bracket list is only used if you write something like this

```
def : Pat<(SplatPat GPR:$rs)>;
```

Where the ComplexPattern is the first node of the pattern. You have patterns that where splat_vector, rv32_splat_i64, and rv32_splat_i64 appear as the first node and don't use SplatPat this way.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93312



More information about the llvm-commits mailing list