[PATCH] D82713: Improve stack object printing.

Madhur Amilkanthwar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 1 05:22:50 PDT 2020


madhur13490 updated this revision to Diff 274764.
madhur13490 added a comment.

rebase + address comments


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82713

Files:
  llvm/include/llvm/CodeGen/MachineFrameInfo.h
  llvm/lib/CodeGen/MachineFrameInfo.cpp
  llvm/test/CodeGen/AArch64/tailcall_misched_graph.ll


Index: llvm/test/CodeGen/AArch64/tailcall_misched_graph.ll
===================================================================
--- llvm/test/CodeGen/AArch64/tailcall_misched_graph.ll
+++ llvm/test/CodeGen/AArch64/tailcall_misched_graph.ll
@@ -21,11 +21,12 @@
 ; PR23459 has a test case that we where miscompiling because of this at the
 ; time.
 
-; COMMON: Frame Objects
-; COMMON:  fi#-4: {{.*}} fixed, at location [SP+8]
-; COMMON:  fi#-3: {{.*}} fixed, at location [SP]
-; COMMON:  fi#-2: {{.*}} fixed, at location [SP+8]
-; COMMON:  fi#-1: {{.*}} fixed, at location [SP]
+; COMMON: Fixed Objects: 4
+; COMMON: Frame Objects:
+; COMMON:  fi#-4: {{.*}} fixed:, at location [SP+8], Split Slot: No
+; COMMON:  fi#-3: {{.*}} fixed:, at location [SP], Split Slot: No
+; COMMON:  fi#-2: {{.*}} fixed:, at location [SP+8], Split Slot: No
+; COMMON:  fi#-1: {{.*}} fixed:, at location [SP], Split Slot: No
 
 ; The order that these appear in differes in GISel than SDAG, but the
 ; dependency relationship still holds.
Index: llvm/lib/CodeGen/MachineFrameInfo.cpp
===================================================================
--- llvm/lib/CodeGen/MachineFrameInfo.cpp
+++ llvm/lib/CodeGen/MachineFrameInfo.cpp
@@ -215,6 +215,8 @@
   const TargetFrameLowering *FI = MF.getSubtarget().getFrameLowering();
   int ValOffset = (FI ? FI->getOffsetOfLocalArea() : 0);
 
+  OS << "Fixed Objects: " << static_cast<unsigned>(NumFixedObjects) << "\n";
+
   OS << "Frame Objects:\n";
 
   for (unsigned i = 0, e = Objects.size(); i != e; ++i) {
@@ -222,7 +224,7 @@
     OS << "  fi#" << (int)(i-NumFixedObjects) << ": ";
 
     if (SO.StackID != 0)
-      OS << "id=" << static_cast<unsigned>(SO.StackID) << ' ';
+      OS << "stack id: " << static_cast<unsigned>(SO.StackID) << ", ";
 
     if (SO.Size == ~0ULL) {
       OS << "dead\n";
@@ -235,7 +237,7 @@
     OS << ", align=" << SO.Alignment.value();
 
     if (i < NumFixedObjects)
-      OS << ", fixed";
+      OS << ", fixed:";
     if (i < NumFixedObjects || SO.SPOffset != -1) {
       int64_t Off = SO.SPOffset - ValOffset;
       OS << ", at location [SP";
@@ -243,9 +245,10 @@
         OS << "+" << Off;
       else if (Off < 0)
         OS << Off;
-      OS << "]";
+      OS << "], ";
     }
-    OS << "\n";
+    OS << "Split Slot: "
+       << (static_cast<bool>(SO.isSpillSlot) == true ? "Yes" : "No") << "\n";
   }
 }
 
Index: llvm/include/llvm/CodeGen/MachineFrameInfo.h
===================================================================
--- llvm/include/llvm/CodeGen/MachineFrameInfo.h
+++ llvm/include/llvm/CodeGen/MachineFrameInfo.h
@@ -822,7 +822,7 @@
   BitVector getPristineRegs(const MachineFunction &MF) const;
 
   /// Used by the MachineFunction printer to print information about
-  /// stack objects. Implemented in MachineFunction.cpp.
+  /// stack objects.
   void print(const MachineFunction &MF, raw_ostream &OS) const;
 
   /// dump - Print the function to stderr.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82713.274764.patch
Type: text/x-patch
Size: 2944 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200701/31934836/attachment.bin>


More information about the llvm-commits mailing list