[Inliner] Merge the attributes of the caller and callee functions
authorAkira Hatanaka <ahatanaka@apple.com>
Wed, 13 Jan 2016 06:02:45 +0000 (06:02 +0000)
committerAkira Hatanaka <ahatanaka@apple.com>
Wed, 13 Jan 2016 06:02:45 +0000 (06:02 +0000)
commitd3a4714c99cd7c7bf4fbac7cc7dcd4e6dcf2c4fb
tree00aac8806d46f3d558be60d0cf708cd6e2863971
parent2fbc59f8d0013311a95ca04abccae56c22f879ef
[Inliner] Merge the attributes of the caller and callee functions

This patch turns off the fast-math optimization attribute on the caller
if the callee's fast-math attribute is not turned on.

For example,

- before inlining
 caller: "less-precise-fpmad"="true"
 callee: "less-precise-fpmad"="false"

- after inlining
 caller: "less-precise-fpmad"="false"

Alternatively, it's possible to block inlining if the caller's and
callee's attributes don't match. If this approach is preferable to the
one in this patch, we can discuss post-commit.

rdar://problem/19836465

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257575 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/Attributes.td
test/Transforms/Inline/attributes.ll