[PATCH] D139902: IR: Add nofpclass parameter attribute

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 5 14:18:20 PST 2023


efriedma added inline comments.


================
Comment at: llvm/docs/LangRef.rst:1409
+    indicated by ``nofpclass``, the value read is a :ref:`poison value
+    <poisonvalues>`.
+
----------------
arsenm wrote:
> nikic wrote:
> > The wording here is unusual -- we'd normally just say that the argument/return is poison. Why the focus on the using operation here?
> I'm mostly worried about allowing clang to just throw nofpclass(nan) on every float parameter with -ffinite-math-only. What if someone is just using a floating point operand for nan boxing, and never actually performs a floating point operation on it?
Adding nofpclass markings for -ffinite-math-only is sort of aggressive, yes.  But we're already pretty aggressive in other ways, too: currently, LangRef says that passing a nan to an nnan operation produces poison.

There's maybe some argument that we should introduce some sort of weaker form of "finite-only math" that doesn't involve undefined behavior, but I haven't seen anyone push for that.


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

https://reviews.llvm.org/D139902



More information about the llvm-commits mailing list