[PATCH] D117741: [RISCV] Set CostPerUse to 1 iff RVC is enabled

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 19 20:48:39 PST 2022


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVRegisterInfo.cpp:353
+RISCVRegisterInfo::getRegisterCostTableIndex(const MachineFunction &MF) const {
+  return MF.getSubtarget<RISCVSubtarget>().hasStdExtC();
+}
----------------
Stylistically I'd prefer this as `MF.getSubtarget<RISCVSubtarget>().hasStdExtC() ? 1 : 0`

That makes it a little more obvious it is returning an index and not boolean.



================
Comment at: llvm/test/CodeGen/RISCV/rvv/fixed-vector-strided-load-store.ll:1
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
 ; RUN: opt %s -S -riscv-gather-scatter-lowering -mtriple=riscv64 -mattr=+m,+experimental-v -riscv-v-vector-bits-min=256 | FileCheck %s
----------------
Drop this line. the test is generated by both update_llc_test_checks.py and update_test_checks.py. Having the comment at the top prevents the opposite script from being able to run on the file.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D117741



More information about the llvm-commits mailing list