diff options
author | Wolfgang Pieb <Wolfgang.Pieb@sony.com> | 2019-01-30 20:37:14 +0000 |
---|---|---|
committer | Wolfgang Pieb <Wolfgang.Pieb@sony.com> | 2019-01-30 20:37:14 +0000 |
commit | facd052e165996a15133466c39d3a87ec13d85e2 (patch) | |
tree | 294f6dcd8d2a26fb2b9d0e9bf3ca388bd323b87f /llvm/lib/CodeGen/AsmPrinter | |
parent | 9c3b588db9ddf5582e4d1e3ff931d7b1cac7d8c8 (diff) | |
download | bcm5719-llvm-facd052e165996a15133466c39d3a87ec13d85e2.tar.gz bcm5719-llvm-facd052e165996a15133466c39d3a87ec13d85e2.zip |
Reverting r352642 - Handle restore instructions in LiveDebugValues - as it's causing
assertions on some buildbots.
llvm-svn: 352666
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 47 |
1 files changed, 34 insertions, 13 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index a29e17addb5..4c9fe59af42 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -754,25 +754,46 @@ static bool emitComments(const MachineInstr &MI, raw_ostream &CommentOS, const TargetInstrInfo *TII = MF->getSubtarget().getInstrInfo(); // Check for spills and reloads + int FI; + + const MachineFrameInfo &MFI = MF->getFrameInfo(); bool Commented = false; + auto getSize = + [&MFI](const SmallVectorImpl<const MachineMemOperand *> &Accesses) { + unsigned Size = 0; + for (auto A : Accesses) + if (MFI.isSpillSlotObjectIndex( + cast<FixedStackPseudoSourceValue>(A->getPseudoValue()) + ->getFrameIndex())) + Size += A->getSize(); + return Size; + }; + // We assume a single instruction only has a spill or reload, not // both. - Optional<unsigned> Size; - if ((Size = MI.getRestoreSize(TII))) { - CommentOS << *Size << "-byte Reload"; - Commented = true; - } else if ((Size = MI.getFoldedRestoreSize(TII))) { - if (*Size) { - CommentOS << *Size << "-byte Folded Reload"; + const MachineMemOperand *MMO; + SmallVector<const MachineMemOperand *, 2> Accesses; + if (TII->isLoadFromStackSlotPostFE(MI, FI)) { + if (MFI.isSpillSlotObjectIndex(FI)) { + MMO = *MI.memoperands_begin(); + CommentOS << MMO->getSize() << "-byte Reload"; Commented = true; } - } else if ((Size = MI.getSpillSize(TII))) { - CommentOS << *Size << "-byte Spill"; - Commented = true; - } else if ((Size = MI.getFoldedSpillSize(TII))) { - if (*Size) { - CommentOS << *Size << "-byte Folded Spill"; + } else if (TII->hasLoadFromStackSlot(MI, Accesses)) { + if (auto Size = getSize(Accesses)) { + CommentOS << Size << "-byte Folded Reload"; + Commented = true; + } + } else if (TII->isStoreToStackSlotPostFE(MI, FI)) { + if (MFI.isSpillSlotObjectIndex(FI)) { + MMO = *MI.memoperands_begin(); + CommentOS << MMO->getSize() << "-byte Spill"; + Commented = true; + } + } else if (TII->hasStoreToStackSlot(MI, Accesses)) { + if (auto Size = getSize(Accesses)) { + CommentOS << Size << "-byte Folded Spill"; Commented = true; } } |