[PATCH] D14707: add fast-math-flags to 'call' instructions (PR21290)

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 19 11:21:24 PST 2015


spatel added a subscriber: t.p.northover.
spatel added a reviewer: t.p.northover.
spatel added a comment.

In http://reviews.llvm.org/D14707#292002, @majnemer wrote:

> My 2 ยข:
>
> It seems more natural to me to phrase these as normal string attributes at the point of the call and construct an FMF from a CallSite but I can see arguments for and against both designs.


I thought about it some more, looked into the implementation, and convinced myself that the attribute solution isn't as good.

1. We already have some of the function-level FMF attributes here: http://reviews.llvm.org/diffusion/L/browse/llvm/trunk/include/llvm/IR/Attributes.td but they are 'StrBoolAttr' rather than the 'EnumAttr' that I think we want. The names don't match. There would be some duplication/ugliness here at the least.
2. This is the big one: we'd need to update independent chunks of code any time FMF changes. This scares me because I'm still hoping to get advanced reciprocal estimate functionality ( http://reviews.llvm.org/rL239001 , http://reviews.llvm.org/rL239536 ) into instruction-level FMF. Those settings don't exist at all in IR currently, so in an LTO build, they simply disappear. I think the same thing happens with FMAs. The likelihood that FMF internals require changes seems high, so having a unified FMF interface for all instructions is the better solution.




http://reviews.llvm.org/D14707





More information about the llvm-commits mailing list