From 5318d9e5165a6e7f10c602ab85cb24ed2dfceed4 Mon Sep 17 00:00:00 2001 From: Philip Reames Date: Thu, 18 Feb 2021 08:59:38 -0800 Subject: [PATCH] [splitkit] Add a minor wrapper function for readability [NFC] --- llvm/lib/CodeGen/SplitKit.cpp | 6 +++--- llvm/lib/CodeGen/SplitKit.h | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/llvm/lib/CodeGen/SplitKit.cpp b/llvm/lib/CodeGen/SplitKit.cpp index ff993b4..5f97729 100644 --- a/llvm/lib/CodeGen/SplitKit.cpp +++ b/llvm/lib/CodeGen/SplitKit.cpp @@ -1531,7 +1531,7 @@ bool SplitAnalysis::shouldSplitSingleBlock(const BlockInfo &BI, void SplitEditor::splitSingleBlock(const SplitAnalysis::BlockInfo &BI) { openIntv(); - SlotIndex LastSplitPoint = SA.getLastSplitPoint(BI.MBB->getNumber()); + SlotIndex LastSplitPoint = SA.getLastSplitPoint(BI.MBB); SlotIndex SegStart = enterIntvBefore(std::min(BI.FirstInstr, LastSplitPoint)); if (!BI.LiveOut || BI.LastInstr < LastSplitPoint) { @@ -1685,7 +1685,7 @@ void SplitEditor::splitRegInBlock(const SplitAnalysis::BlockInfo &BI, return; } - SlotIndex LSP = SA.getLastSplitPoint(BI.MBB->getNumber()); + SlotIndex LSP = SA.getLastSplitPoint(BI.MBB); if (!LeaveBefore || LeaveBefore > BI.LastInstr.getBoundaryIndex()) { // @@ -1762,7 +1762,7 @@ void SplitEditor::splitRegOutBlock(const SplitAnalysis::BlockInfo &BI, << ", enter after " << EnterAfter << (BI.LiveIn ? ", stack-in" : ", defined in block")); - SlotIndex LSP = SA.getLastSplitPoint(BI.MBB->getNumber()); + SlotIndex LSP = SA.getLastSplitPoint(BI.MBB); assert(IntvOut && "Must have register out"); assert(BI.LiveOut && "Must be live-out"); diff --git a/llvm/lib/CodeGen/SplitKit.h b/llvm/lib/CodeGen/SplitKit.h index ec51014..0963576 100644 --- a/llvm/lib/CodeGen/SplitKit.h +++ b/llvm/lib/CodeGen/SplitKit.h @@ -238,6 +238,10 @@ public: return IPA.getLastInsertPoint(*CurLI, *MF.getBlockNumbered(Num)); } + SlotIndex getLastSplitPoint(MachineBasicBlock *BB) { + return IPA.getLastInsertPoint(*CurLI, *BB); + } + MachineBasicBlock::iterator getLastSplitPointIter(MachineBasicBlock *BB) { return IPA.getLastInsertPointIter(*CurLI, *BB); } -- 2.7.4