[PATCH] D137574: PEI should be able to use backward walk in replaceFrameIndicesBackward.

Alexander via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 17 09:09:22 PST 2022


alex-t added inline comments.


================
Comment at: llvm/lib/CodeGen/PrologEpilogInserter.cpp:1497
+
+      bool Removed = TRI.eliminateFrameIndex(MI, SPAdj, i, RS);
+      // Restore to unify logic with a shift back that happens in the end of
----------------
arsenm wrote:
> I think handling frame indexes one operand at a time is a broken API for the case where there are multiple. I think interpreting this as "removed" is too aggressive. About about returning true if the instruction was modified in place, in which case we need to resume the loop looking for additional frame indices 
We leave the loop only in case the instruction is removed and hence it is fully processed. We never remove instruction if it still has frame index operands to process. If the instruction is not removed (by calling eraseFromParent) we iterate through the rest of the operands looking for the FI if any.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137574



More information about the llvm-commits mailing list