[PATCH] D15393: [X86] Order the local stack symbols to improve code size and locality.

Zia Ansari via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 11 09:39:00 PST 2016


zansari added a comment.

Hi Joerg,

Unless I'm missing something, this shouldn't affect stack protection in any way. The algorithm only works within the scope of this:

  // Then assign frame offsets to stack objects that are not used to spill
  // callee saved registers.
  for (unsigned i = 0, e = MFI->getObjectIndexEnd(); i != e; ++i) {
    if (MFI->isObjectPreAllocated(i) &&
        MFI->getUseLocalStackAllocationBlock())
      continue;
    if (i >= MinCSFrameIndex && i <= MaxCSFrameIndex)
      continue;
    if (RS && RS->isScavengingFrameIndex((int)i))
      continue;
    if (MFI->isDeadObjectIndex(i))
      continue;
    if (MFI->getStackProtectorIndex() == (int)i)
      continue;
    if (ProtectedObjs.count(i))
      continue;
  
    AdjustStackOffset(MFI, i, StackGrowsDown, Offset, MaxAlign, Skew);
  }

and reorders only these objects per whatever custom algorithm. The stack protection (and any other "special" conditions that need allocation) are handled prior to this allocation walk.. Please correct me, if I'm wrong.


http://reviews.llvm.org/D15393





More information about the llvm-commits mailing list