diff options
author | Owen Anderson <resistor@mac.com> | 2008-08-06 20:29:20 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2008-08-06 20:29:20 +0000 |
commit | 987b5057d3d8379783d646a81cd23b78f57ff995 (patch) | |
tree | 9ae662fd9867ce0b81bed02766353b1d2b47f8c6 /llvm/lib/CodeGen | |
parent | f9fca2f2dc9295aae43c5304895e8c3deef0e66b (diff) | |
download | bcm5719-llvm-987b5057d3d8379783d646a81cd23b78f57ff995.tar.gz bcm5719-llvm-987b5057d3d8379783d646a81cd23b78f57ff995.zip |
We don't need to try to coalesce input vregs that are the same as the output vreg.
llvm-svn: 54422
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/StrongPHIElimination.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/StrongPHIElimination.cpp b/llvm/lib/CodeGen/StrongPHIElimination.cpp index b276e80e92b..11b8ca361c6 100644 --- a/llvm/lib/CodeGen/StrongPHIElimination.cpp +++ b/llvm/lib/CodeGen/StrongPHIElimination.cpp @@ -421,6 +421,7 @@ void StrongPHIElimination::processBlock(MachineBasicBlock* MBB) { while (P != MBB->end() && P->getOpcode() == TargetInstrInfo::PHI) { unsigned DestReg = P->getOperand(0).getReg(); + // Don't both doing PHI elimination for dead PHI's. if (P->registerDefIsDead(DestReg)) { ++P; @@ -442,6 +443,12 @@ void StrongPHIElimination::processBlock(MachineBasicBlock* MBB) { // Iterate over the operands of the PHI node for (int i = P->getNumOperands() - 1; i >= 2; i-=2) { unsigned SrcReg = P->getOperand(i-1).getReg(); + + // Don't need to try to coalesce a register with itself. + if (SrcReg == DestReg) { + ProcessedNames.insert(SrcReg); + continue; + } // Check for trivial interferences via liveness information, allowing us // to avoid extra work later. Any registers that interfere cannot both |