[PATCH] Refactor AttributeSet::typeIncompatible to avoid creating new AttributeSets

Pete Cooper peter_cooper at apple.com
Wed Apr 22 18:12:14 PDT 2015


Hi Hal

These 2 patches change the method typeIncompatible to avoid creating temporary AttributeSets.  This actually shows up as a fraction of a percent of compile time because the IR verify pass calls typeIncompatible to check the attributes on calls.

The first patch is attrbuilder-remove.diff which adds methods to the AttrBuilder itself to remove another AttrBuilder and to check if there is any overlap between 2 AttrBuilders.

The next patch - type-incompatible.diff - actually uses this new functionality to change that method to return an AttrBuilder and rewrite the few calls to it to work on an AttrBuilder instead of AttributeSet.

This is only the start of the work I’d like to do on AttributeSets.  There’s more to be done to reduce the number of sets we allocate (my current thinking involves adding an AttributeSetRef which references an index in to a set, and is safe because of the immutability of AttributeSet).  Let me know if you have anything else in mind.

Cheers,
Pete

-------------- next part --------------
A non-text attachment was scrubbed...
Name: type-incompatible.diff
Type: application/octet-stream
Size: 8695 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150422/ad72ef1b/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: attrbuilder-remove.diff
Type: application/octet-stream
Size: 4774 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150422/ad72ef1b/attachment-0001.obj>


More information about the llvm-commits mailing list