diff options
author | Owen Anderson <resistor@mac.com> | 2008-06-27 01:22:50 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2008-06-27 01:22:50 +0000 |
commit | b827c26e1e49944e44604402d2414b259dba6900 (patch) | |
tree | 5364adb77993d85e46a440fe1bf243e4ee535e74 | |
parent | e6b6bae536a382ca76c738275b82c73b026cd6bf (diff) | |
download | external_llvm-b827c26e1e49944e44604402d2414b259dba6900.tar.gz external_llvm-b827c26e1e49944e44604402d2414b259dba6900.tar.bz2 external_llvm-b827c26e1e49944e44604402d2414b259dba6900.zip |
Don't perform expensive queries checking for super and sub registers when we know that there aren't any.
This speed up LiveVariables on instcombine at -O0 -g from 0.3855s to 0.3503s. Look for more improvements in this area soon!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52804 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/MachineInstr.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp index e008c9a61b..5da6a317cb 100644 --- a/lib/CodeGen/MachineInstr.cpp +++ b/lib/CodeGen/MachineInstr.cpp @@ -780,6 +780,7 @@ bool MachineInstr::addRegisterDead(unsigned IncomingReg, const TargetRegisterInfo *RegInfo, bool AddIfNotFound) { bool isPhysReg = TargetRegisterInfo::isPhysicalRegister(IncomingReg); + bool hasAliases = isPhysReg && RegInfo->getAliasSet(IncomingReg) == 0; bool Found = false; SmallVector<unsigned,4> DeadOps; for (unsigned i = 0, e = getNumOperands(); i != e; ++i) { @@ -790,7 +791,7 @@ bool MachineInstr::addRegisterDead(unsigned IncomingReg, if (Reg == IncomingReg) { MO.setIsDead(); Found = true; - } else if (isPhysReg && MO.isDead() && + } else if (hasAliases && MO.isDead() && TargetRegisterInfo::isPhysicalRegister(Reg)) { // There exists a super-register that's marked dead. if (RegInfo->isSuperRegister(IncomingReg, Reg)) |