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 | c8a4973389b8d6b75c06c02112873e823a82a27b (patch) | |
tree | 71641837b58d89d2589322f4d0c0d4d1be342a98 /llvm/lib/CodeGen/PreAllocSplitting.cpp | |
parent | bf030845324856e57782241c3c1c4fe63e73572a (diff) | |
download | bcm5719-llvm-c8a4973389b8d6b75c06c02112873e823a82a27b.tar.gz bcm5719-llvm-c8a4973389b8d6b75c06c02112873e823a82a27b.zip |
Fixed some tests to avoid LiveIntervals::getInstructionFromIndex(..) overhead where possible. Thanks to Jakob for the suggestions.
llvm-svn: 114798
Diffstat (limited to 'llvm/lib/CodeGen/PreAllocSplitting.cpp')
-rw-r--r-- | llvm/lib/CodeGen/PreAllocSplitting.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/PreAllocSplitting.cpp b/llvm/lib/CodeGen/PreAllocSplitting.cpp index ee228a9f619..68d28e4f971 100644 --- a/llvm/lib/CodeGen/PreAllocSplitting.cpp +++ b/llvm/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))) { |