[PATCH] D14614: [WinEH] Find root frame correctly in CLR funclets

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 12 13:51:17 PST 2015


rnk added inline comments.

================
Comment at: lib/Target/X86/X86FrameLowering.cpp:1414
@@ +1413,3 @@
+    // resides at in the main function.
+    UsedSize = getPSPSlotOffsetFromSP(MF) + SlotSize;
+  } else {
----------------
JosephTremoulet wrote:
> I don't understand what I'd need to tweak.  Do you mean so that funclets can access their copy of the PSPSym?  I'm generating those accesses directly in the prolog emission (the only references are in the prolog), so they aren't using the offset of the frame object -- that object only describes the PSPSym slot in the root function's frame.  Or did you mean to optimize frame size by allocating the PSPSym towards the bottom of the frame?  Or something else entirely?
I was mostly responding to the TODO below. You could do something similar to this register scavenging code to ensure that UsedSize is typically small:
  // Make sure the special register scavenging spill slot is closest to the
  // stack pointer.
  if (RS && !EarlyScavengingSlots) {
    SmallVector<int, 2> SFIs;
    RS->getScavengingFrameIndices(SFIs);
    for (SmallVectorImpl<int>::iterator I = SFIs.begin(),
           IE = SFIs.end(); I != IE; ++I)
      AdjustStackOffset(MFI, *I, StackGrowsDown, Offset, MaxAlign, Skew);
  }


http://reviews.llvm.org/D14614





More information about the llvm-commits mailing list