diff options
author | Cameron Zwarich <zwarich@apple.com> | 2010-12-28 23:02:56 +0000 |
---|---|---|
committer | Cameron Zwarich <zwarich@apple.com> | 2010-12-28 23:02:56 +0000 |
commit | 146666eabb282fd2a973c70967d7f8370866a944 (patch) | |
tree | 5e7e1bc739530e5782e37d0a406a48ea13d909e1 /llvm/lib/CodeGen/StrongPHIElimination.cpp | |
parent | 2f15503d5ab2d39e243a99681fb2a2b3aae7b315 (diff) | |
download | bcm5719-llvm-146666eabb282fd2a973c70967d7f8370866a944.tar.gz bcm5719-llvm-146666eabb282fd2a973c70967d7f8370866a944.zip |
Revert the optimization in r122596. It is correct for all current targets, but
it relies on assumptions that may not be true in the future.
llvm-svn: 122608
Diffstat (limited to 'llvm/lib/CodeGen/StrongPHIElimination.cpp')
-rw-r--r-- | llvm/lib/CodeGen/StrongPHIElimination.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/StrongPHIElimination.cpp b/llvm/lib/CodeGen/StrongPHIElimination.cpp index f84fdbe5bc2..5713e6aed29 100644 --- a/llvm/lib/CodeGen/StrongPHIElimination.cpp +++ b/llvm/lib/CodeGen/StrongPHIElimination.cpp @@ -472,9 +472,16 @@ StrongPHIElimination::SplitInterferencesForBasicBlock( for (MachineBasicBlock::iterator BBI = MBB.begin(), BBE = MBB.end(); BBI != BBE; ++BBI) { for (MachineInstr::const_mop_iterator I = BBI->operands_begin(), - E = BBI->operands_end(); I != E && I->isReg() && I->isDef(); ++I) { + E = BBI->operands_end(); I != E; ++I) { const MachineOperand& MO = *I; + // FIXME: This would be faster if it were possible to bail out of checking + // an instruction's operands after the explicit defs, but this is incorrect + // for variadic instructions, which may appear before register allocation + // in the future. + if (!MO.isReg() || !MO.isDef()) + continue; + unsigned DestReg = MO.getReg(); if (!DestReg || !TargetRegisterInfo::isVirtualRegister(DestReg)) continue; |