diff options
Diffstat (limited to 'llvm/lib/CodeGen/RegAllocGreedy.cpp')
-rw-r--r-- | llvm/lib/CodeGen/RegAllocGreedy.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/llvm/lib/CodeGen/RegAllocGreedy.cpp b/llvm/lib/CodeGen/RegAllocGreedy.cpp index d48f37f1ca6..5f1f28ff1ad 100644 --- a/llvm/lib/CodeGen/RegAllocGreedy.cpp +++ b/llvm/lib/CodeGen/RegAllocGreedy.cpp @@ -3120,24 +3120,23 @@ void RAGreedy::reportNumberOfSplillsReloads(MachineLoop *L, unsigned &Reloads, // Handle blocks that were not included in subloops. if (Loops->getLoopFor(MBB) == L) for (MachineInstr &MI : *MBB) { - SmallVector<TargetInstrInfo::FrameAccess, 2> Accesses; + SmallVector<const MachineMemOperand *, 2> Accesses; + auto isSpillSlotAccess = [&MFI](const MachineMemOperand *A) { + return MFI.isSpillSlotObjectIndex( + cast<FixedStackPseudoSourceValue>(A->getPseudoValue()) + ->getFrameIndex()); + }; if (TII->isLoadFromStackSlot(MI, FI) && MFI.isSpillSlotObjectIndex(FI)) ++Reloads; else if (TII->hasLoadFromStackSlot(MI, Accesses) && - llvm::any_of(Accesses, - [&MFI](const TargetInstrInfo::FrameAccess &A) { - return MFI.isSpillSlotObjectIndex(A.FI); - })) + llvm::any_of(Accesses, isSpillSlotAccess)) ++FoldedReloads; else if (TII->isStoreToStackSlot(MI, FI) && MFI.isSpillSlotObjectIndex(FI)) ++Spills; else if (TII->hasStoreToStackSlot(MI, Accesses) && - llvm::any_of(Accesses, - [&MFI](const TargetInstrInfo::FrameAccess &A) { - return MFI.isSpillSlotObjectIndex(A.FI); - })) + llvm::any_of(Accesses, isSpillSlotAccess)) ++FoldedSpills; } |