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

Quentin Colombet via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 11 14:15:56 PDT 2016


qcolombet added inline comments.

================
Comment at: lib/CodeGen/PrologEpilogInserter.cpp:52
@@ -51,1 +51,3 @@
 
+using MBBVector = SmallVector<MachineBasicBlock *, 4>;
+static void DoSpillCalleeSavedRegs(MachineFunction &MF, RegScavenger *RS,
----------------
I’d say for consistency with LLVM codebase we should stick to typedef.

================
Comment at: lib/CodeGen/PrologEpilogInserter.cpp:67
@@ +66,3 @@
+    // XXX replace this with some sort of target hook
+    if (TM->getTargetTriple().getArch() == Triple::wasm32) {
+      SpillCalleeSavedRegisters = [](MachineFunction &, RegScavenger *,
----------------
Indeed :).

================
Comment at: lib/CodeGen/PrologEpilogInserter.cpp:211
@@ +210,3 @@
+           "Virtual-register targets do not support register scavenging");
+  } else {
+    // If register scavenging is needed, as we've enabled doing it as a
----------------
I still don’t like this part of the patch.
We could do another helper function here, couldn’t we?

================
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);
----------------
Unrelated change.


http://reviews.llvm.org/D18366





More information about the llvm-commits mailing list