[PATCH] [Inliner] Use whitelist instead of blacklist when checking function attribute compatibility and make the check stricter

Akira Hatanaka ahatanak at gmail.com
Tue Mar 3 17:20:35 PST 2015


On Fri, Feb 20, 2015 at 3:24 PM, Akira Hatanaka <ahatanak at gmail.com> wrote:

> Hi dexonsmith, chandlerc, echristo,
> This patch changes functionsHaveCompatibleAttribute to list the attributes
> that can be ignored rather than listing the attributes that should be
> checked (whitelist, instead of blacklist). I think this is better as we
> won't unintentionally inline a function that is incompatible with the
> caller when a new function attribute is added.
> In my patch, I've whitelisted all function attributes listed in
> http://llvm.org/docs/LangRef.html#function-attributes except for these
> two:
> alignstack(<n>)
> noimplicitfloat
> None of the string attributes have been added to the whitelist yet, so
> functions that have incompatible string attributes (for example, functions
> that have incompatible fast-math attributes) will not get inlined.
> http://reviews.llvm.org/D7802
> Files:
>   lib/Analysis/IPA/InlineCost.cpp
>   test/Transforms/Inline/attributes.ll
>   http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150303/abdb3bbb/attachment.html>

More information about the llvm-commits mailing list