From 914c8328244477d68043f36107e98794e3b9dab7 Mon Sep 17 00:00:00 2001 From: Serguei Katkov Date: Wed, 21 Apr 2021 12:29:25 +0700 Subject: [PATCH] [InlineSpiller] Clean-up isSpillCandBB This is mostly NFC except that for end of BB not previous slot is used. Idx is used to find a def of sibling live interval in that slot. The def on end of MBB and on previous slot of end MBB should be the same, so it should be NFC. Reviewers: reames, qcolombet, MatzeB, wmi, rnk Reviewed By: rnk Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D100922 --- llvm/lib/CodeGen/InlineSpiller.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/llvm/lib/CodeGen/InlineSpiller.cpp b/llvm/lib/CodeGen/InlineSpiller.cpp index 4635daf71e54..5f1cac49c4ef 100644 --- a/llvm/lib/CodeGen/InlineSpiller.cpp +++ b/llvm/lib/CodeGen/InlineSpiller.cpp @@ -1245,13 +1245,8 @@ bool HoistSpillHelper::rmFromMergeableSpills(MachineInstr &Spill, /// i.e., there should be a living sibling of OrigReg at the insert point. bool HoistSpillHelper::isSpillCandBB(LiveInterval &OrigLI, VNInfo &OrigVNI, MachineBasicBlock &BB, Register &LiveReg) { - SlotIndex Idx; + SlotIndex Idx = IPA.getLastInsertPoint(OrigLI, BB); Register OrigReg = OrigLI.reg(); - MachineBasicBlock::iterator MI = IPA.getLastInsertPointIter(OrigLI, BB); - if (MI != BB.end()) - Idx = LIS.getInstructionIndex(*MI); - else - Idx = LIS.getMBBEndIdx(&BB).getPrevSlot(); SmallSetVector &Siblings = Virt2SiblingsMap[OrigReg]; assert(OrigLI.getVNInfoAt(Idx) == &OrigVNI && "Unexpected VNI");