[llvm-commits] [llvm] r53364 - /llvm/branches/Apple/Gaz/lib/CodeGen/RegAllocLocal.cpp
Bill Wendling
isanbard at gmail.com
Wed Jul 9 14:32:21 PDT 2008
Author: void
Date: Wed Jul 9 16:32:21 2008
New Revision: 53364
URL: http://llvm.org/viewvc/llvm-project?rev=53364&view=rev
Log:
Pulling r53359 into Gaz:
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.
Modified:
llvm/branches/Apple/Gaz/lib/CodeGen/RegAllocLocal.cpp
Modified: llvm/branches/Apple/Gaz/lib/CodeGen/RegAllocLocal.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Gaz/lib/CodeGen/RegAllocLocal.cpp?rev=53364&r1=53363&r2=53364&view=diff
==============================================================================
--- llvm/branches/Apple/Gaz/lib/CodeGen/RegAllocLocal.cpp (original)
+++ llvm/branches/Apple/Gaz/lib/CodeGen/RegAllocLocal.cpp Wed Jul 9 16:32:21 2008
@@ -611,13 +611,24 @@
// 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())
More information about the llvm-commits
mailing list