From: Chris Lattner Date: Thu, 14 Jul 2011 18:53:50 +0000 (+0000) Subject: Stop the ValueMapper from calling getAllMetadata, which unpacks DebugLoc into X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=4692be11a9ecee983760b0420ef2775a4c3706dc;p=oota-llvm.git 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135172 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Utils/ValueMapper.cpp b/lib/Transforms/Utils/ValueMapper.cpp index 30fc60081d5..e728fd16a30 100644 --- a/lib/Transforms/Utils/ValueMapper.cpp +++ b/lib/Transforms/Utils/ValueMapper.cpp @@ -167,9 +167,10 @@ void llvm::RemapInstruction(Instruction *I, ValueToValueMapTy &VMap, } } - // Remap attached metadata. + // Remap attached metadata. Don't bother remapping DebugLoc, it can never + // have mappings to do. SmallVector, 4> MDs; - I->getAllMetadata(MDs); + I->getAllMetadataOtherThanDebugLoc(MDs); for (SmallVectorImpl >::iterator MI = MDs.begin(), ME = MDs.end(); MI != ME; ++MI) { MDNode *Old = MI->second;