[LLVMdev] Destroying MDNodeOperand

Duncan P. N. Exon Smith dexonsmith at apple.com
Tue Jul 21 14:55:24 PDT 2015


> On 2015-Jul-15, at 14:49, Pan, Wei <wei.pan at intel.com> wrote:
> 
> Hello,
> 
> From VTune profiler, we notice that function MDNodeOperand::deleted, called from destructor ~llvmContextImpl, consumes ~18% (0.67 sec) of the total compilation time (3.7sec). This llvm module has ~400 metadata. Is this destruction time unexpectedly high or just expected? Or we should avoid to use this amount of metadata in the first place.  Any thoughts or suggestions?

I'm not surprised by this.  The Metadata hierarchy generally was
stuck with some inefficient API prior to 3.6.

Note that the class no longer exists in ToT.  You might want to check
out the 3.6 release notes to see how Metadata changed; it should be a
fair bit more efficient.  It's been tuned for memory usage so far
(not yet compile time), but I've noticed compile time improvements as
well.

If you can reproduce such a bottleneck in LLVMContextImpl teardown on
ToT, please file a PR and CC me and I'll look into it.



More information about the llvm-dev mailing list