[llvm-branch-commits] [llvm-branch] r95919 - in /llvm/branches/Apple/Hermes/lib/Transforms: IPO/StripSymbols.cpp Scalar/GVN.cpp

Devang Patel dpatel at apple.com
Thu Feb 11 13:04:57 PST 2010


Author: dpatel
Date: Thu Feb 11 15:04:57 2010
New Revision: 95919

URL: http://llvm.org/viewvc/llvm-project?rev=95919&view=rev
Log:

Merge from mainline.

$ svn merge -c 95807 https://llvm.org/svn/llvm-project/llvm/trunk
--- Merging r95807 into '.':
U    lib/Transforms/IPO/StripSymbols.cpp
$ svn merge -c 95828 https://llvm.org/svn/llvm-project/llvm/trunk
--- Merging r95828 into '.':
U    lib/Transforms/Scalar/GVN.cpp


Modified:
    llvm/branches/Apple/Hermes/lib/Transforms/IPO/StripSymbols.cpp
    llvm/branches/Apple/Hermes/lib/Transforms/Scalar/GVN.cpp

Modified: llvm/branches/Apple/Hermes/lib/Transforms/IPO/StripSymbols.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Hermes/lib/Transforms/IPO/StripSymbols.cpp?rev=95919&r1=95918&r2=95919&view=diff

==============================================================================
--- llvm/branches/Apple/Hermes/lib/Transforms/IPO/StripSymbols.cpp (original)
+++ llvm/branches/Apple/Hermes/lib/Transforms/IPO/StripSymbols.cpp Thu Feb 11 15:04:57 2010
@@ -214,6 +214,15 @@
     Changed = true;
   }
 
+  if (Function *DbgVal = M.getFunction("llvm.dbg.value")) {
+    while (!DbgVal->use_empty()) {
+      CallInst *CI = cast<CallInst>(DbgVal->use_back());
+      CI->eraseFromParent();
+    }
+    DbgVal->eraseFromParent();
+    Changed = true;
+  }
+
   NamedMDNode *NMD = M.getNamedMetadata("llvm.dbg.gv");
   if (NMD) {
     Changed = true;

Modified: llvm/branches/Apple/Hermes/lib/Transforms/Scalar/GVN.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Hermes/lib/Transforms/Scalar/GVN.cpp?rev=95919&r1=95918&r2=95919&view=diff

==============================================================================
--- llvm/branches/Apple/Hermes/lib/Transforms/Scalar/GVN.cpp (original)
+++ llvm/branches/Apple/Hermes/lib/Transforms/Scalar/GVN.cpp Thu Feb 11 15:04:57 2010
@@ -1891,6 +1891,10 @@
 /// by inserting it into the appropriate sets
 bool GVN::processInstruction(Instruction *I,
                              SmallVectorImpl<Instruction*> &toErase) {
+  // Ignore dbg info intrinsics.
+  if (isa<DbgInfoIntrinsic>(I))
+    return false;
+
   if (LoadInst *LI = dyn_cast<LoadInst>(I)) {
     bool Changed = processLoad(LI, toErase);
 





More information about the llvm-branch-commits mailing list