[llvm-commits] [llvm] r135172 - /llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp

Chris Lattner sabre at nondot.org
Thu Jul 14 11:53:50 PDT 2011


Author: lattner
Date: Thu Jul 14 13:53:50 2011
New Revision: 135172

URL: http://llvm.org/viewvc/llvm-project?rev=135172&view=rev
Log:
Stop the ValueMapper from calling getAllMetadata, which unpacks DebugLoc into
an MDNode.  This saves a bunch of time and memory in the IR linker, e.g. when 
doing LTO of files with debug info.


Modified:
    llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp

Modified: llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp?rev=135172&r1=135171&r2=135172&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp Thu Jul 14 13:53:50 2011
@@ -167,9 +167,10 @@
     }
   }
 
-  // Remap attached metadata.
+  // Remap attached metadata.  Don't bother remapping DebugLoc, it can never
+  // have mappings to do.
   SmallVector<std::pair<unsigned, MDNode *>, 4> MDs;
-  I->getAllMetadata(MDs);
+  I->getAllMetadataOtherThanDebugLoc(MDs);
   for (SmallVectorImpl<std::pair<unsigned, MDNode *> >::iterator
        MI = MDs.begin(), ME = MDs.end(); MI != ME; ++MI) {
     MDNode *Old = MI->second;





More information about the llvm-commits mailing list