[PATCH] D15085: [AttributeSet] Overload AttributeSet::addAttribute to reduce compile time

Akira Hatanaka via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 30 11:28:46 PST 2015


ahatanak created this revision.
ahatanak added a subscriber: llvm-commits.

The new overloaded function is used when an attribute is added to a large number of slots of an AttributeSet (for example, to function parameters). This is much faster than calling AttributeSet::addAttribute once per slot, because AttributeSet::getImpl (which calls FoldingSet::FIndNodeOrInsertPos) is called only once per function instead of once per slot.

With this patch applied, clang compiles a file which used to take over 22 minutes in just 13 seconds.

http://reviews.llvm.org/D15085

Files:
  include/llvm/IR/Attributes.h
  lib/IR/Attributes.cpp
  lib/Transforms/InstCombine/InstCombineCalls.cpp
  lib/Transforms/Scalar/CorrelatedValuePropagation.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15085.41413.patch
Type: text/x-patch
Size: 5041 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151130/60b2c20a/attachment.bin>


More information about the llvm-commits mailing list