[llvm] [RISCV] Use RVInstVV as the base for CustomSiFiveVMACC. NFC (PR #179565)

via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 3 14:53:06 PST 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-risc-v

Author: Craig Topper (topperc)

<details>
<summary>Changes</summary>

This correctly names the operands vd, vs1, and vs2 instead of rd, rs1, and rs2. RVInstVCCustom2 is now only used for VCIX which has its own operand naming problems.

I'm considering using named operand indices in RISCVAsmParser::validateInstruction for the RVVConstraints, but first I would have to make vs1, vs2 named correctly across all vector instructions.

---
Full diff: https://github.com/llvm/llvm-project/pull/179565.diff


1 Files Affected:

- (modified) llvm/lib/Target/RISCV/RISCVInstrInfoXSf.td (+8-3) 


``````````diff
diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoXSf.td b/llvm/lib/Target/RISCV/RISCVInstrInfoXSf.td
index 4516ba9f79a1b..c59b59c410e91 100644
--- a/llvm/lib/Target/RISCV/RISCVInstrInfoXSf.td
+++ b/llvm/lib/Target/RISCV/RISCVInstrInfoXSf.td
@@ -182,14 +182,19 @@ class SiFiveVMACCScheds<string name> {
 
 let hasSideEffects = 0, mayLoad = 0, mayStore = 0 in {
 class CustomSiFiveVMACC<bits<6> funct6, RISCVVFormat opv, string opcodestr>
-    : RVInstVCCustom2<funct6{5-2}, opv.Value, (outs VR:$rd), (ins VR:$rs1, VR:$rs2),
-                      opcodestr, "$rd, $rs1, $rs2">,
+    : RVInstVV<funct6, opv, (outs VR:$vd), (ins VR:$vs1, VR:$vs2), opcodestr,
+               "$vd, $vs1, $vs2">,
       SchedTernaryMC<SiFiveVMACCScheds<NAME>.write,
                      SiFiveVMACCScheds<NAME>.read,
                      SiFiveVMACCScheds<NAME>.read,
                      SiFiveVMACCScheds<NAME>.read> {
   let vm = 1;
-  let funct6_lo2 = funct6{1-0};
+
+  let Inst{6-0} = OPC_CUSTOM_2.Value;
+
+  let RVVConstraint = NoConstraint;
+  let ElementsDependOn = EltDepsVLMask;
+  let ReadsPastVL = 1;
 }
 }
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/179565


More information about the llvm-commits mailing list