[PATCH] D41226: LiveDebugValues spill recognition expasnsion

Nikola Prica via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 19 12:53:36 PST 2017


NikolaPrica added a comment.

One thing crossed my mid. There is another approach for this. Since it is verified that we are processing  spill instruction with the following condition:

  // To identify a spill instruction, use the same criteria as in AsmPrinter.
  if (!((TII->isStoreToStackSlotPostFE(MI, FI) ||
         TII->hasStoreToStackSlot(MI, MMO, FI)) &&
        FrameInfo.isSpillSlotObjectIndex(FI)))
    return false;

The bottom part is trying to identify spilled register and return it through method argument. In spill instruction we have stack pointer register and spilled register? So maybe the following could be used?

   const TargetLowering *TLI = MF->getSubtarget().getTargetLowering();
   unsigned SP = TLI->getStackPointerRegisterToSaveRestore();
    
   // In a spill instruction we have stack pointer register and spilled
  // register.
   Reg = 0;
   for (const MachineOperand &MO : MI.operands()) {
     if (MO.isReg() && MO.isUse()) 
       if (MO.getReg() != SP) 
         Reg = MO.getReg();
   }


https://reviews.llvm.org/D41226





More information about the llvm-commits mailing list