XCore target: Enable frames larger than 65535 to be lowered

Robert Lytton robert at xmos.com
Tue Nov 12 10:27:10 PST 2013

Hi Richard,

Please could you re-review the changed patch - would a diff of the patches be helpful?

+static void EmitAdjustCfaOffset(MachineBasicBlock &MBB,
> Doesn't the caller know the absolute offset here (in which case it can just pass it in)?
I've recoded so that we can calculate the absolute offset.
The function is now called EmitDefCfaOffset() to reflect this change.

+static void IfNeededExtSP(MachineBasicBlock &MBB,
+static void IfNeededLDAWSP(MachineBasicBlock &MBB,
> These could do with a brief comment explaining what they do.
Done-ish. Not so brief.

+    // Allocate space on the stack at the same time as saving LR.
+    int Offset = RemainingAdj % MaxImmU16;
+    if (!Offset)
+      Offset = MaxImmU16;   // Offset's range is 1 to MaxImmU16.
+    RemainingAdj -= Offset;
> This can be simplified to Offset = RemainingAdj % (MaxImmU16 + 1)
The original idea was to pick up the remainder at the start, leaving only jumps of MaxImmU16.
However, I've recoded to do the remainder at the end (consistent with FP output)

+static void GetSpillList(std::pair<unsigned,int> (&SpillList)[2],
> I think it might be better to use SmallVector<std::pair<unsigned,int>,2>. This removes the need for the InvalidSpillSlot sentinel, simplifying the code.
> Also I'd prefer it if GetSpillList() always returned the list in the same order (i.e. RestoringSpill should be removed). The epilogue can iterate over the list in reverse order - this makes it clear that the epilogue is the reverse of the prologue.

> Finally could you also add a test for a function with a frame pointer.
Sorry, I had some examples but they required large const handling... and were in the next patch.
I have added a "-disable-fp-elim" test run to the epilogue_prologue.ll test file.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131112/4cab1c3f/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PatchLargeFrames
Type: application/octet-stream
Size: 22330 bytes
Desc: PatchLargeFrames
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131112/4cab1c3f/attachment.obj>

More information about the llvm-commits mailing list