[PATCH] D127727: [RISCV] Turn on SeparateConstOffsetFromGEPPass for RISC-V target and added optional modification strategy in it

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 14 09:09:48 PDT 2022


craig.topper added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp:363
+              const Value *NonConstantBaseValue)
+      : GEPPointer(GEPPointer), PreviousIndices(PreviousIndices),
+        NonConstantBaseValue(NonConstantBaseValue) {}
----------------
I think there you should be a std::move on `PreviousIndices`


================
Comment at: llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp:366
+
+  inline bool operator<(const GEPBaseInfo &rhs) const {
+
----------------
rhs -> RHS


================
Comment at: llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp:921
       if (Field != 0) {
-        NeedsExtraction = true;
+        if (CheckProfitability || PossibleBases.size() == 0) {
+          PossibleBases.emplace_back(GEP->getPointerOperand(),
----------------
`PossibleBase.size() == 0` -> `PossibleBases.empty()`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127727



More information about the llvm-commits mailing list