[PATCH] D62857: [RISCV] Prevent hoisting some adds after shifts

Alex Bradbury via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 6 03:00:25 PDT 2019


asb added inline comments.


================
Comment at: llvm/lib/Target/RISCV/Utils/RISCVMatInt.cpp:78
+
+int getIntMatCost(int64_t Val, bool Is64Bit) {
+  InstSeq MatSeq;
----------------
Should add a comment to document what this does, and to document that it really does calculate the cost of materialising an integer (i.e. doesn't take into account whether there might be an opportunity for merging it into an addi). You should also document that it is invalid to call this for a Val which can't be represented with 32Bits when Is64Bit is false (that triggers an assert in generateInstSeq - I think it's probably still ok to treat that as an API misuse rather than adding more explicit error handling).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62857





More information about the llvm-commits mailing list