[PATCH] D93312: [RISCV] Add ISel support for RVV vector/scalar forms

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 23 11:09:46 PST 2020


craig.topper accepted this revision.
craig.topper added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td:417
+                              vti.Vector, vti.Vector, XLenVT, vti.Mask, vti.SEW,
+                              vti.LMul, vti.RegClass, vti.RegClass, ImmType>;
+  }
----------------
frasercrmck wrote:
> frasercrmck wrote:
> > craig.topper wrote:
> > > This might not catch all immediates it could. The operand of the splat_vector is going to be XLenVT. When the scalar element type is less than XLenVT, only some of the bits of the splat_vector operand are going to be used so the other bits should be ignored for the purposes of checking if the immediate is simm5. We might get lucky because DAGTypeLegalizer::PromoteIntRes_Constant prefers sign_extend.
> > That's a good point. I do think `PromoteIntRes_Constant` is saving us here. Is this something that we should fix without a test case, or something to note for later?
> Is this something we can leave for a later patch, now that we've got `selectVSplat` and friends which can handle it relatively simply?
We can leave it for a later patch.


================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td:32
+// Penalize the generic form to give the simm5 variant precedence
+let Complexity = 1 in
+def SplatPat       : ComplexPattern<vAny, 1, "selectVSplat", []>;
----------------
Isn't Complexity the last defaulted argument to ComplexPattern?


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