summaryrefslogtreecommitdiff
path: root/lib/CodeGen/RegAllocGreedy.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-08-05 22:43:23 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-08-05 22:43:23 +0000
commitb3ef7f6b97eb4a61bbafc0a97fb94086919dcbd6 (patch)
treebf37e364284503cfc34cd883f87d92e68456f178 /lib/CodeGen/RegAllocGreedy.cpp
parent2d6d86be84ee355223ccd20b7f87a0c9971c50c9 (diff)
downloadllvm-b3ef7f6b97eb4a61bbafc0a97fb94086919dcbd6.tar.gz
llvm-b3ef7f6b97eb4a61bbafc0a97fb94086919dcbd6.tar.bz2
llvm-b3ef7f6b97eb4a61bbafc0a97fb94086919dcbd6.tar.xz
Also use shouldSplitSingleBlock() in the fallback splitting mode.
Drop the use of SplitAnalysis::getMultiUseBlocks, there is no need to go through a SmallPtrSet any more. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136992 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAllocGreedy.cpp')
-rw-r--r--lib/CodeGen/RegAllocGreedy.cpp26
1 files changed, 18 insertions, 8 deletions
diff --git a/lib/CodeGen/RegAllocGreedy.cpp b/lib/CodeGen/RegAllocGreedy.cpp
index 90d3810437..ef083c1ccb 100644
--- a/lib/CodeGen/RegAllocGreedy.cpp
+++ b/lib/CodeGen/RegAllocGreedy.cpp
@@ -1489,15 +1489,25 @@ unsigned RAGreedy::trySplit(LiveInterval &VirtReg, AllocationOrder &Order,
}
// Then isolate blocks with multiple uses.
- SplitAnalysis::BlockPtrSet Blocks;
- if (SA->getMultiUseBlocks(Blocks)) {
- LiveRangeEdit LREdit(VirtReg, NewVRegs, this);
- SE->reset(LREdit);
- SE->splitSingleBlocks(Blocks);
- setStage(NewVRegs.begin(), NewVRegs.end(), RS_Spill);
- if (VerifyEnabled)
- MF->verify(this, "After splitting live range around basic blocks");
+ unsigned Reg = SA->getParent().reg;
+ bool SingleInstrs = RegClassInfo.isProperSubClass(MRI->getRegClass(Reg));
+ LiveRangeEdit LREdit(VirtReg, NewVRegs, this);
+ SE->reset(LREdit);
+ ArrayRef<SplitAnalysis::BlockInfo> UseBlocks = SA->getUseBlocks();
+ for (unsigned i = 0; i != UseBlocks.size(); ++i) {
+ const SplitAnalysis::BlockInfo &BI = UseBlocks[i];
+ if (SA->shouldSplitSingleBlock(BI, SingleInstrs))
+ SE->splitSingleBlock(BI);
}
+ // No blocks were split.
+ if (LREdit.empty())
+ return 0;
+
+ // We did split for some blocks.
+ SE->finish();
+ setStage(NewVRegs.begin(), NewVRegs.end(), RS_Spill);
+ if (VerifyEnabled)
+ MF->verify(this, "After splitting live range around basic blocks");
// Don't assign any physregs.
return 0;