[PATCH] D100922: [InlineSpiller] Clean-up isSpillCandBB
Serguei Katkov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 20 22:38:05 PDT 2021
skatkov created this revision.
skatkov added reviewers: reames, qcolombet, MatzeB, wmi, rnk.
Herald added a subscriber: hiraditya.
skatkov requested review of this revision.
Herald added a project: LLVM.
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 previous slot of end MBB should be the same,
so it should be NFC.
https://reviews.llvm.org/D100922
Files:
llvm/lib/CodeGen/InlineSpiller.cpp
Index: llvm/lib/CodeGen/InlineSpiller.cpp
===================================================================
--- llvm/lib/CodeGen/InlineSpiller.cpp
+++ llvm/lib/CodeGen/InlineSpiller.cpp
@@ -1245,13 +1245,8 @@
/// 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<Register, 16> &Siblings = Virt2SiblingsMap[OrigReg];
assert(OrigLI.getVNInfoAt(Idx) == &OrigVNI && "Unexpected VNI");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100922.339102.patch
Type: text/x-patch
Size: 892 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210421/ed7bfd49/attachment.bin>
More information about the llvm-commits
mailing list