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

Akira Hatanaka ahatanak at gmail.com
Fri Feb 20 15:24:24 PST 2015


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

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7802.20434.patch
Type: text/x-patch
Size: 6652 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150220/8ac30de3/attachment.bin>


More information about the llvm-commits mailing list