diff options
author | Lang Hames <lhames@gmail.com> | 2010-09-26 03:37:09 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2010-09-26 03:37:09 +0000 |
commit | cec2945f3092c4d087716eb96062d7c7ef6fe60c (patch) | |
tree | b49566e95f0f1e30d989e324cf72d260af433a4d /lib/CodeGen/PreAllocSplitting.cpp | |
parent | a6c1dbd541d93359a7dd8fbcba3d7f0bf77e60c5 (diff) |
Fixed some tests to avoid LiveIntervals::getInstructionFromIndex(..) overhead where possible. Thanks to Jakob for the suggestions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114798 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/PreAllocSplitting.cpp')
-rw-r--r-- | lib/CodeGen/PreAllocSplitting.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/CodeGen/PreAllocSplitting.cpp b/lib/CodeGen/PreAllocSplitting.cpp index ee228a9f61..68d28e4f97 100644 --- a/lib/CodeGen/PreAllocSplitting.cpp +++ b/lib/CodeGen/PreAllocSplitting.cpp @@ -807,8 +807,7 @@ bool PreAllocSplitting::Rematerialize(unsigned VReg, VNInfo* ValNo, MachineBasicBlock& MBB = *RestorePt->getParent(); MachineBasicBlock::iterator KillPt = BarrierMBB->end(); - if (LIs->getInstructionFromIndex(ValNo->def) == 0 || - DefMI->getParent() == BarrierMBB) + if (!DefMI || DefMI->getParent() == BarrierMBB) KillPt = findSpillPoint(BarrierMBB, Barrier, NULL, RefsInMBB); else KillPt = llvm::next(MachineBasicBlock::iterator(DefMI)); @@ -1005,7 +1004,7 @@ bool PreAllocSplitting::SplitRegLiveInterval(LiveInterval *LI) { SlotIndex SpillIndex; MachineInstr *SpillMI = NULL; int SS = -1; - if (LIs->getInstructionFromIndex(ValNo->def) == 0) { + if (!DefMI) { // If we don't know where the def is we must split just before the barrier. if ((SpillMI = FoldSpill(LI->reg, RC, 0, Barrier, BarrierMBB, SS, RefsInMBB))) { |