1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

Check that the register is live-in to the loop header before inserting copies in

the loop predecessors.

The register can be live-out from a predecessor without being live-in to the
loop header if there is a critical edge from the predecessor.

llvm-svn: 122123
This commit is contained in:
Jakob Stoklund Olesen 2010-12-18 01:06:19 +00:00
parent 30eef45106
commit a2f2eab8d4

View File

@ -1077,11 +1077,13 @@ void SplitEditor::splitAroundLoop(const MachineLoop *Loop) {
// Create new live interval for the loop.
openIntv();
// Insert copies in the predecessors.
for (SplitAnalysis::BlockPtrSet::iterator I = Blocks.Preds.begin(),
E = Blocks.Preds.end(); I != E; ++I) {
MachineBasicBlock &MBB = const_cast<MachineBasicBlock&>(**I);
enterIntvAtEnd(MBB);
// Insert copies in the predecessors if live-in to the header.
if (lis_.isLiveInToMBB(edit_.getParent(), Loop->getHeader())) {
for (SplitAnalysis::BlockPtrSet::iterator I = Blocks.Preds.begin(),
E = Blocks.Preds.end(); I != E; ++I) {
MachineBasicBlock &MBB = const_cast<MachineBasicBlock&>(**I);
enterIntvAtEnd(MBB);
}
}
// Switch all loop blocks.