summaryrefslogtreecommitdiff
path: root/lib/CodeGen/StrongPHIElimination.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2008-04-02 03:00:13 +0000
committerOwen Anderson <resistor@mac.com>2008-04-02 03:00:13 +0000
commit52b1733df4bb3cafa7a81384da7e81a1fa66cea5 (patch)
tree4411e27387b4c81935fcd8ff1d626c747a8727d5 /lib/CodeGen/StrongPHIElimination.cpp
parent59df878391b5a10d184636fed608f6a9cb29761f (diff)
downloadllvm-52b1733df4bb3cafa7a81384da7e81a1fa66cea5.tar.gz
llvm-52b1733df4bb3cafa7a81384da7e81a1fa66cea5.tar.bz2
llvm-52b1733df4bb3cafa7a81384da7e81a1fa66cea5.tar.xz
In some situations, we need to check for local interferences between the PHI
node and its inputs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49070 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/StrongPHIElimination.cpp')
-rw-r--r--lib/CodeGen/StrongPHIElimination.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/CodeGen/StrongPHIElimination.cpp b/lib/CodeGen/StrongPHIElimination.cpp
index 6416690e29..a632da6de0 100644
--- a/lib/CodeGen/StrongPHIElimination.cpp
+++ b/lib/CodeGen/StrongPHIElimination.cpp
@@ -483,8 +483,17 @@ void StrongPHIElimination::processBlock(MachineBasicBlock* MBB) {
std::vector<std::pair<unsigned, unsigned> > localInterferences;
processPHIUnion(P, PHIUnion, DF, localInterferences);
+ // If one of the inputs is defined in the same block as the current PHI
+ // then we need to check for a local interference between that input and
+ // the PHI.
+ for (std::map<unsigned, unsigned>::iterator I = PHIUnion.begin(),
+ E = PHIUnion.end(); I != E; ++I)
+ if (MRI.getVRegDef(I->first)->getParent() == P->getParent())
+ localInterferences.push_back(std::make_pair(I->first,
+ P->getOperand(0).getReg()));
+
// The dominator forest walk may have returned some register pairs whose
- // interference cannot be determines from dominator analysis. We now
+ // interference cannot be determined from dominator analysis. We now
// examine these pairs for local interferences.
for (std::vector<std::pair<unsigned, unsigned> >::iterator I =
localInterferences.begin(), E = localInterferences.end(); I != E; ++I) {
@@ -527,7 +536,7 @@ void StrongPHIElimination::processBlock(MachineBasicBlock* MBB) {
}
}
- // Add the renaming set for this PHI node to our overal renaming information
+ // Add the renaming set for this PHI node to our overall renaming information
RenameSets.insert(std::make_pair(P->getOperand(0).getReg(), PHIUnion));
// Remember which registers are already renamed, so that we don't try to