[PATCH] D126060: [RISCV] Add basic cost modelling for fixed length vector arithmetic

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 20 07:19:12 PDT 2022


reames added a comment.

Minor style comments only.  Don't have enough experience with cost modeling to comment on the heuristic itself and will leave that to others.



================
Comment at: llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp:213
+
+  if (!ST->useRVVForFixedLengthVectors())
+    return BaseT::getArithmeticInstrCost(Opcode, Ty, CostKind, Opd1Info,
----------------
I'd fold this into the prior if in this case.  


================
Comment at: llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp:221
+
+  if (ISD != ISD::ADD && ISD != ISD::AND && ISD != ISD::OR &&
+      ISD != ISD::SDIV && ISD != ISD::SHL && ISD != ISD::SRA &&
----------------
A switch would be much more readable here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126060



More information about the llvm-commits mailing list