XCore target: Make handling of large frames not dependent upon an FP.

Richard Osborne richard at xmos.com
Thu Nov 28 14:26:51 PST 2013


+  // This is only requried when there is no FP and offsets are greater than
+  // ~256KB (~64Kwords). Thus only for code run on the emulator!

requried -> required

+  // The arbitary value of 0xf000 allows frames of up to ~240KB before spill
+  // slots are added for the use of eliminateFrameIndex() register scavenging.

arbitary -> arbitrary


+  // We previously asserted SPAdj == 0.
+  unsigned ScratchOffset = RS->scavengeRegister(&XCore::GRRegsRegClass, II, 0);
+  RS->setUsed(ScratchOffset);

+  // We previously asserted SPAdj == 0.
+  unsigned ScratchBase;
+  if (OpCode==XCore::STWFI) {

It’s confusing to refer to the old code in a comment like this, I would just take these comments out before you commit.

Looks good to me otherwise.

On 20 Nov 2013, at 18:19, Robert Lytton <robert at xmos.com<mailto:robert at xmos.com>> wrote:

Hi,

Here is a patch to enhance the XCores handling of large frames.

Q: is the handling of register scavenging correct below? e.g. the use of RS->setUsed() &  RegState::Kill
      // We previously asserted SPAdj == 0.
      unsigned ScratchOffset = RS->scavengeRegister(&XCore::GRRegsRegClass, II, 0);
      RS->setUsed(ScratchOffset);
      loadConstant(II, TII, ScratchOffset, Offset);
      BuildMI(MBB, II, dl, TII.get(XCore::LDW_3r), Reg)
              .addReg(FrameReg)
              .addReg(ScratchOffset, RegState::Kill);

Details:

    eliminateFrameIndex() has been reworked to handle both small & large frames
    with either a FP or SP.
    An additional Slot is required for Scavenging spills when not using FP for large frames.
    Reworked the handling of Register Scavenging.

    Whether we are using an FP or not, whether it is a large frame or not,
    and whether we are using a large code model or not are now independent.

Robert

<PatchLargeFrameHandling>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131128/17e096b4/attachment.html>


More information about the llvm-commits mailing list