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

Joseph Tremoulet via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 12 14:00:03 PST 2015


JosephTremoulet added inline comments.

================
Comment at: lib/Target/X86/X86FrameLowering.cpp:1414
@@ +1413,3 @@
+    // resides at in the main function.
+    UsedSize = getPSPSlotOffsetFromSP(MF) + SlotSize;
+  } else {
----------------
rnk wrote:
> 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);
>   }
Ah, got it.  Yes, something along those lines would be great.  I'm not sure if it's cool to directly teach calculateFrameObjectOffsets special knowledge about the PEI slot or if it would be better to have some "allocate me low" annotation, and if it's "allocate me low" I don't know if it would make sense to fold scavenger handling into that.. also not sure if maybe scavenger considerations need to "trump" PSP considerations, and then does that mean there are different strengths of "allocate me low".  In fact for a while I was considering trying to change things to allow createFixedObject to do its "fixing" relative to another base like the top of the outgoing argument area (but then that wouldn't allow trumping the scavengers and what about targets that don't pre-allocate the outgoing argument area)... anyway, yes, happy to separate that as an optimization problem and tackle it in the future :).


http://reviews.llvm.org/D14614





More information about the llvm-commits mailing list