[PATCH] D67839: [FPEnv] Document requirement of function attributes with constrained floating point

Andy Kaylor via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 25 12:16:55 PDT 2019


andrew.w.kaylor added a subscriber: pengfei.
andrew.w.kaylor added a comment.

In D67839#1683038 <https://reviews.llvm.org/D67839#1683038>, @kpn wrote:

> In D67839#1681121 <https://reviews.llvm.org/D67839#1681121>, @uweigand wrote:
>
> > I agree with marking function call sites as "strictfp".
>
>
> Say, would this apply to all function call sites? Or just to ones that aren't intrinsics?


I think all.

We've got a problem yet to solve with architecture-specific intrinsics. There are a lot of X86-intrinsics that perform floating point operations. I expect other architecture have the same issue. I doubt that the optimizer attempts to transform many of them, but we'll need to do something when we get to ISel. In theory we could create constrained versions of all of them, but it might be better to just mark them as "strictfp" and have ISel make conservative assumptions. We could attach the local rounding mode and exception behavior as metadata if that would be helpful.

@pengfei , do you think the "strictfp" attribute on an intrinsic would tell you enough for X86 instruction selection? I think for any x86 instructions that take rounding mode operands the intrinsic would already have that explicitly specified, right?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67839/new/

https://reviews.llvm.org/D67839





More information about the llvm-commits mailing list