[PATCH] D129179: [RISCV] Extend use of SHXADD instructions in RVV spill/reload code.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 9 12:27:05 PDT 2022


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfo.cpp:1809
+    uint32_t ShiftAmount;
+    if (NumOfVReg % 3 == 0) {
+      Opc = RISCV::SH1ADD;
----------------
`NumOfVReg % 3 == 0` when we really matched the `(NumOfVReg % 9 == 0 && isPowerOf2_64(NumOfVReg / 9)` case. Any number divisible by 9 is also divisible by 3.


================
Comment at: llvm/test/CodeGen/RISCV/rvv/allocate-lmul-2-4-8.ll:238
+; ZBA-NEXT:    slli a0, a0, 2
+; ZBA-NEXT:    sh1add a0, a0, a0
+; ZBA-NEXT:    sub sp, sp, a0
----------------
Should we be testing more than sh1add?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129179



More information about the llvm-commits mailing list