[llvm] r324283 - [PEI][NFC] Move StackSize opt-remark code next to -warn-stack code

Francis Visoiu Mistrih via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 5 14:46:54 PST 2018


Author: thegameg
Date: Mon Feb  5 14:46:54 2018
New Revision: 324283

URL: http://llvm.org/viewvc/llvm-project?rev=324283&view=rev
Log:
[PEI][NFC] Move StackSize opt-remark code next to -warn-stack code

This allows us to make sure we're always having the same sizes in both
remarks and warnings.

Modified:
    llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp

Modified: llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp?rev=324283&r1=324282&r2=324283&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp (original)
+++ llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp Mon Feb  5 14:46:54 2018
@@ -227,6 +227,12 @@ bool PEI::runOnMachineFunction(MachineFu
     DiagnosticInfoStackSize DiagStackSize(F, StackSize);
     F.getContext().diagnose(DiagStackSize);
   }
+  ORE->emit([&]() {
+    return MachineOptimizationRemarkAnalysis(DEBUG_TYPE, "StackSize",
+                                             Fn.getFunction().getSubprogram(),
+                                             &Fn.front())
+           << ore::NV("NumStackBytes", StackSize) << " stack bytes in function";
+  });
 
   delete RS;
   SaveBlocks.clear();
@@ -949,13 +955,6 @@ void PEI::calculateFrameObjectOffsets(Ma
   int64_t StackSize = Offset - LocalAreaOffset;
   MFI.setStackSize(StackSize);
   NumBytesStackSpace += StackSize;
-
-  ORE->emit([&]() {
-    return MachineOptimizationRemarkAnalysis(DEBUG_TYPE, "StackSize",
-                                             Fn.getFunction().getSubprogram(),
-                                             &Fn.front())
-           << ore::NV("NumStackBytes", StackSize) << " stack bytes in function";
-  });
 }
 
 /// insertPrologEpilogCode - Scan the function for modified callee saved




More information about the llvm-commits mailing list