We don't need to try to coalesce input vregs that are the same as the output vreg.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54422 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Owen Anderson 2008-08-06 20:29:20 +00:00
parent 9b49120408
commit 9860b71b6a

View File

@ -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;
@ -443,6 +444,12 @@ void StrongPHIElimination::processBlock(MachineBasicBlock* MBB) {
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
// be in the renaming set, so choose one and add copies for it instead.