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

Devang Patel dpatel at apple.com
Thu Jul 14 13:12:16 PDT 2011


On Jul 14, 2011, at 11:53 AM, Chris Lattner wrote:

> 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.

That's not true. llvm-ld attached two .ll files. You should only get two metadata entries for functions (DW_TAG_subprogram) after linking. If you get three, then mapping is broken during linking.
-
Devang

-------------- next part --------------
A non-text attachment was scrubbed...
Name: a.ll
Type: application/octet-stream
Size: 1388 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110714/6b30b123/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: b.ll
Type: application/octet-stream
Size: 1388 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110714/6b30b123/attachment-0001.obj>
-------------- next part --------------


>   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;
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list