OSDN Git Service

[AttributeSet] Overload AttributeSet::addAttribute to reduce compile
authorAkira Hatanaka <ahatanaka@apple.com>
Wed, 2 Dec 2015 06:58:49 +0000 (06:58 +0000)
committerAkira Hatanaka <ahatanaka@apple.com>
Wed, 2 Dec 2015 06:58:49 +0000 (06:58 +0000)
commitec268660c8dee1cc4831ca36df0577e057742eb8
treee94c02d828363bb0259442bede63dbce391daf12
parent1bd8c8c6356c8fc47152d886e332be93013b1efc
[AttributeSet] Overload AttributeSet::addAttribute to reduce compile
time.

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 commit, clang compiles a file which used to take over 22
minutes in just 13 seconds.

rdar://problem/23581000

Differential Revision: http://reviews.llvm.org/D15085

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254491 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/Attributes.h
lib/IR/Attributes.cpp
lib/Transforms/InstCombine/InstCombineCalls.cpp
lib/Transforms/Scalar/CorrelatedValuePropagation.cpp