|
@@ -44,34 +44,32 @@ class LLVM_LIBRARY_VISIBILITY InsertPointAnalysis {
|
|
private:
|
|
private:
|
|
const LiveIntervals &LIS;
|
|
const LiveIntervals &LIS;
|
|
|
|
|
|
- /// Current LiveInterval for which to insert split or spill.
|
|
|
|
- const LiveInterval *CurLI;
|
|
|
|
-
|
|
|
|
/// Last legal insert point in each basic block in the current function.
|
|
/// Last legal insert point in each basic block in the current function.
|
|
/// The first entry is the first terminator, the second entry is the
|
|
/// The first entry is the first terminator, the second entry is the
|
|
/// last valid point to insert a split or spill for a variable that is
|
|
/// last valid point to insert a split or spill for a variable that is
|
|
/// live into a landing pad successor.
|
|
/// live into a landing pad successor.
|
|
SmallVector<std::pair<SlotIndex, SlotIndex>, 8> LastInsertPoint;
|
|
SmallVector<std::pair<SlotIndex, SlotIndex>, 8> LastInsertPoint;
|
|
|
|
|
|
- SlotIndex computeLastInsertPoint(const MachineBasicBlock &MBB);
|
|
|
|
|
|
+ SlotIndex computeLastInsertPoint(const LiveInterval &CurLI,
|
|
|
|
+ const MachineBasicBlock &MBB);
|
|
|
|
|
|
public:
|
|
public:
|
|
InsertPointAnalysis(const LiveIntervals &lis, unsigned BBNum);
|
|
InsertPointAnalysis(const LiveIntervals &lis, unsigned BBNum);
|
|
|
|
|
|
- void setInterval(const LiveInterval *LI) { CurLI = LI; }
|
|
|
|
-
|
|
|
|
- /// Return the base index of the last valid insert point in \pMBB.
|
|
|
|
- SlotIndex getLastInsertPoint(const MachineBasicBlock &MBB) {
|
|
|
|
|
|
+ /// Return the base index of the last valid insert point for \pCurLI in \pMBB.
|
|
|
|
+ SlotIndex getLastInsertPoint(const LiveInterval &CurLI,
|
|
|
|
+ const MachineBasicBlock &MBB) {
|
|
unsigned Num = MBB.getNumber();
|
|
unsigned Num = MBB.getNumber();
|
|
// Inline the common simple case.
|
|
// Inline the common simple case.
|
|
if (LastInsertPoint[Num].first.isValid() &&
|
|
if (LastInsertPoint[Num].first.isValid() &&
|
|
!LastInsertPoint[Num].second.isValid())
|
|
!LastInsertPoint[Num].second.isValid())
|
|
return LastInsertPoint[Num].first;
|
|
return LastInsertPoint[Num].first;
|
|
- return computeLastInsertPoint(MBB);
|
|
|
|
|
|
+ return computeLastInsertPoint(CurLI, MBB);
|
|
}
|
|
}
|
|
|
|
|
|
- /// Returns the last insert point as an iterator.
|
|
|
|
- MachineBasicBlock::iterator getLastInsertPointIter(MachineBasicBlock &);
|
|
|
|
|
|
+ /// Returns the last insert point as an iterator for \pCurLI in \pMBB.
|
|
|
|
+ MachineBasicBlock::iterator getLastInsertPointIter(const LiveInterval &CurLI,
|
|
|
|
+ MachineBasicBlock &MBB);
|
|
};
|
|
};
|
|
|
|
|
|
/// SplitAnalysis - Analyze a LiveInterval, looking for live range splitting
|
|
/// SplitAnalysis - Analyze a LiveInterval, looking for live range splitting
|
|
@@ -215,11 +213,11 @@ public:
|
|
bool shouldSplitSingleBlock(const BlockInfo &BI, bool SingleInstrs) const;
|
|
bool shouldSplitSingleBlock(const BlockInfo &BI, bool SingleInstrs) const;
|
|
|
|
|
|
SlotIndex getLastSplitPoint(unsigned Num) {
|
|
SlotIndex getLastSplitPoint(unsigned Num) {
|
|
- return IPA.getLastInsertPoint(*MF.getBlockNumbered(Num));
|
|
|
|
|
|
+ return IPA.getLastInsertPoint(*CurLI, *MF.getBlockNumbered(Num));
|
|
}
|
|
}
|
|
|
|
|
|
MachineBasicBlock::iterator getLastSplitPointIter(MachineBasicBlock *BB) {
|
|
MachineBasicBlock::iterator getLastSplitPointIter(MachineBasicBlock *BB) {
|
|
- return IPA.getLastInsertPointIter(*BB);
|
|
|
|
|
|
+ return IPA.getLastInsertPointIter(*CurLI, *BB);
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|