diff options
| author | Owen Anderson <resistor@mac.com> | 2008-07-09 21:15:10 +0000 |
|---|---|---|
| committer | Owen Anderson <resistor@mac.com> | 2008-07-09 21:15:10 +0000 |
| commit | b42ed21894119835c205a66fcb0dacbb7a81faa2 (patch) | |
| tree | dd07e5d2d1b6c76dabe5e6e998425f2144d1a351 /llvm/lib/CodeGen | |
| parent | 605d38657ace30c01e3c76d1bad5cb2f19970701 (diff) | |
| download | bcm5719-llvm-b42ed21894119835c205a66fcb0dacbb7a81faa2.tar.gz bcm5719-llvm-b42ed21894119835c205a66fcb0dacbb7a81faa2.zip | |
Don't use an expensive check for two-address-ness when we have the information sitting around to determine it much more quickly,
This speeds up the local register allocator from 0.37s to 0.31s on instcombine.
llvm-svn: 53359
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/RegAllocLocal.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/RegAllocLocal.cpp b/llvm/lib/CodeGen/RegAllocLocal.cpp index 9063e6de936..3e1038daa9c 100644 --- a/llvm/lib/CodeGen/RegAllocLocal.cpp +++ b/llvm/lib/CodeGen/RegAllocLocal.cpp @@ -585,13 +585,24 @@ void RALocal::ComputeLocalLiveness(MachineBasicBlock& MBB) { // Defs others than 2-addr redefs _do_ trigger flag changes: // - A def followed by a def is dead // - A use followed by a def is a kill - if (MO.isReg() && MO.getReg() && MO.isDef() && - !I->isRegReDefinedByTwoAddr(MO.getReg())) { + if (MO.isReg() && MO.getReg() && MO.isDef()) { std::map<unsigned, std::pair<MachineInstr*, unsigned> >::iterator last = LastUseDef.find(MO.getReg()); if (last != LastUseDef.end()) { + + // If this is a two address instr, then we don't mark the def + // as killing the use. + if (last->second.first == I && + I->getDesc().getOperandConstraint(last->second.second, + TOI::TIED_TO) == (signed)i) { + LastUseDef[MO.getReg()] = std::make_pair(I, i); + continue; + } + + MachineOperand& lastUD = last->second.first->getOperand(last->second.second); + if (lastUD.isDef()) lastUD.setIsDead(true); else if (lastUD.isUse()) |

