[llvm-commits] [llvm] r52804 - /llvm/trunk/lib/CodeGen/MachineInstr.cpp

Owen Anderson resistor at mac.com
Thu Jun 26 18:22:50 PDT 2008


Author: resistor
Date: Thu Jun 26 20:22:50 2008
New Revision: 52804

URL: http://llvm.org/viewvc/llvm-project?rev=52804&view=rev
Log:
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!

Modified:
    llvm/trunk/lib/CodeGen/MachineInstr.cpp

Modified: llvm/trunk/lib/CodeGen/MachineInstr.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineInstr.cpp?rev=52804&r1=52803&r2=52804&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/MachineInstr.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineInstr.cpp Thu Jun 26 20:22:50 2008
@@ -780,6 +780,7 @@
                                    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 @@
     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))





More information about the llvm-commits mailing list