[PATCH] D15393: [X86] Order the local stack symbols to improve code size and locality.

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 9 21:41:16 PST 2016


majnemer accepted this revision.
majnemer added a comment.
This revision is now accepted and ready to land.

LGTM with nits addressed.


================
Comment at: include/llvm/Target/TargetFrameLowering.h:321-322
@@ +320,4 @@
+  /// By default, just maintain the original order.
+  virtual void orderFrameObjects(const MachineFunction &MF,
+                               SmallVectorImpl<int> &objectsToAllocate) const {
+    return;
----------------
Please clang-format this.

================
Comment at: include/llvm/Target/TargetFrameLowering.h:323
@@ +322,3 @@
+                               SmallVectorImpl<int> &objectsToAllocate) const {
+    return;
+  }
----------------
I'd just keep the function body empty.

================
Comment at: lib/Target/X86/X86FrameLowering.cpp:2764-2766
@@ +2763,5 @@
+    for (auto &MI : MBB) {
+      for (unsigned i = 0, e = MI.getNumOperands(); i != e; ++i) {
+        // Check to see if it's a local stack symbol.
+        if (!MI.getOperand(i).isFI())
+          continue;
----------------
Could this be a range-based for loop over `MI.operands()` ?


http://reviews.llvm.org/D15393





More information about the llvm-commits mailing list