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

Kevin P. Neal via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 24 12:17:10 PDT 2019


kpn added a comment.

In D67839#1681121 <https://reviews.llvm.org/D67839#1681121>, @uweigand wrote:

> I agree with marking function call sites as "strictfp".
>
> But I'm wondering how you came up with this particular list for function definitions?   In particular, I'm not sure whether noimplicitfloat is really needed.  I understand this flag is supposed to prevent unintended use of floating-point registers (e.g. for Linux kernel code).  You don't really need to prevent that for constrained floating point semantics, I think.  (You do need to prevent introduction of floating-point instruction that might cause spurious exception, but e.g. introducing moves through FP registers should still be fine.)


I saw it mentioned in a conversation on the lists at some point. From reading the thread (which I don't have in hand, sorry!) I didn't see anyone disagree. Of course, if it wasn't important enough then maybe there was no good reason to bother at the time. *shrug*

Are we certain that there is no architecture important to LLVM that will ever trap when simply doing a move of arbitrary bytes using FP instructions?

Anybody?

Also, the documentation doesn't say in what circumstances the lack of noimplicitfloat will allow floating point to be introduced. I'm checking on that now. I'm seeing the attribute used in tests with names like "popcnt.ll", so I'm inclined to lean conservative for now at least.

> As to "strictfp" at the function definition, does this actually do anything currently?  I cannot find any LLVM code that checks for this. The documentation also doesn't really say.

I'm certain that I've seen it mentioned in the context of the inliner, but I don't think anyone has done anything to the inliner yet. I admit I'm unclear on other requirements for it.


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