Ugh, perform an optimization that GCC should be able to do itself. This
authorChris Lattner <sabre@nondot.org>
Mon, 9 Feb 2004 01:43:23 +0000 (01:43 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 9 Feb 2004 01:43:23 +0000 (01:43 +0000)
speeds up livevar from .48/.32s -> .45/.31s in LLC on perlbmk

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11217 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/LiveVariables.cpp

index eafbb1c18a327280576d5c92818e3639189dd39c..a8627396cccd23a4707185156f3d77bbac759e69 100644 (file)
@@ -146,14 +146,15 @@ void LiveVariables::HandlePhysRegDef(unsigned Reg, MachineInstr *MI) {
 
   for (const unsigned *AliasSet = RegInfo->getAliasSet(Reg);
        *AliasSet; ++AliasSet) {
-    if (MachineInstr *LastUse = PhysRegInfo[*AliasSet]) {
-      if (PhysRegUsed[*AliasSet])
-       RegistersKilled.insert(std::make_pair(LastUse, *AliasSet));
+    unsigned Alias = *AliasSet;
+    if (MachineInstr *LastUse = PhysRegInfo[Alias]) {
+      if (PhysRegUsed[Alias])
+       RegistersKilled.insert(std::make_pair(LastUse, Alias));
       else
-       RegistersDead.insert(std::make_pair(LastUse, *AliasSet));
+       RegistersDead.insert(std::make_pair(LastUse, Alias));
     }
-    PhysRegInfo[*AliasSet] = MI;
-    PhysRegUsed[*AliasSet] = false;
+    PhysRegInfo[Alias] = MI;
+    PhysRegUsed[Alias] = false;
   }
 }