[PATCH] D18366: Factor PrologEpilogInserter around spilling, frame finalization, and scavenging

Derek Schuff via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 12 14:53:09 PDT 2016


dschuff added a comment.

OK, Here's PEI with register scavenging also factored out.

1. It's still missing the target hook. I'm looking into that.
2. Requiring the query of the TargetMachine at pass instantiation time makes the logic in TargetPassConfig a bit ugly because passes are substituted or disabled by ID but now we have instantiate the pass in TargetPassConfig directly. Maybe there's a better way but this way at least preserves the ability of targets to disable, override, or substitute PrologEpilogInserterID.


================
Comment at: lib/CodeGen/PrologEpilogInserter.cpp:653
@@ -611,1 +652,3 @@
+    unsigned MaxCSFI = MaxCSFrameIndex, MinCSFI = MinCSFrameIndex;
+    for (unsigned i = MaxCSFI; i >= MinCSFI; --i) {
       unsigned Align = MFI->getObjectAlignment(i);
----------------
qcolombet wrote:
> Unrelated change.
It's actually not an unrelated change. MinCSFrameIndex and MaxCSFrameIndex are unsigned. Previously MinCSFrameIndex was initialized to INT_MAX, and when I moved that i made it std::numeric_limits<unsigned>::max() to match the type. But then this casting is wrong because MinCSFI becomes -1 instead of a big number when there are no CSRs. So I decided to fix this type mismatch rather than keep the initializer type mismatch just for the purpose of also being able to keep this type mismatch.


http://reviews.llvm.org/D18366





More information about the llvm-commits mailing list