[llvm-branch-commits] [llvm-branch] r114353 - /llvm/branches/Apple/Morbo/lib/CodeGen/MachineCSE.cpp

Evan Cheng evan.cheng at apple.com
Mon Sep 20 13:50:55 PDT 2010


Author: evancheng
Date: Mon Sep 20 15:50:54 2010
New Revision: 114353

URL: http://llvm.org/viewvc/llvm-project?rev=114353&view=rev
Log:
Merge 114220 and 114222.

Modified:
    llvm/branches/Apple/Morbo/lib/CodeGen/MachineCSE.cpp

Modified: llvm/branches/Apple/Morbo/lib/CodeGen/MachineCSE.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/lib/CodeGen/MachineCSE.cpp?rev=114353&r1=114352&r2=114353&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/lib/CodeGen/MachineCSE.cpp (original)
+++ llvm/branches/Apple/Morbo/lib/CodeGen/MachineCSE.cpp Mon Sep 20 15:50:54 2010
@@ -50,6 +50,10 @@
       AU.addPreserved<MachineDominatorTree>();
     }
 
+    virtual void releaseMemory() {
+      Exps.clear();
+    }
+
   private:
     unsigned CurrVN;
     ScopedHashTable<MachineInstr*, unsigned, MachineInstrExpressionTrait> VNT;
@@ -83,7 +87,7 @@
     unsigned Reg = MO.getReg();
     if (!Reg || TargetRegisterInfo::isPhysicalRegister(Reg))
       continue;
-    if (!MRI->hasOneUse(Reg))
+    if (!MRI->hasOneNonDBGUse(Reg))
       // Only coalesce single use copies. This ensure the copy will be
       // deleted.
       continue;
@@ -370,5 +374,6 @@
   MRI = &MF.getRegInfo();
   AA = &getAnalysis<AliasAnalysis>();
   DT = &getAnalysis<MachineDominatorTree>();
+  CurrVN = 0;
   return ProcessBlock(DT->getRootNode());
 }





More information about the llvm-branch-commits mailing list