[PATCH] D75576: [SDAG] simplify FP binops to undef

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 4 02:20:29 PST 2020


lebedev.ri accepted this revision.
lebedev.ri added a comment.
This revision is now accepted and ready to land.

LGTM, thank you.
If we don't do this in middle-end, we should.

I'm guessing this is already done for `FNEG`?
What about `FCMP`/`PHI`/`SELECT`?



================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:7307
+  // If this operation has 'nnan' or 'ninf' and at least 1 poison operand (an
+  // undef operand can be chosen to be a poisonous value), then the result of
+  // this operation is undef.
----------------
aqjune wrote:
> Nit: I think it is opposite; poison -> undef is allowed, but undef -> poison is not allowed. LangRef says a poison value may be relaxed into an undef value, which takes an arbitrary bit-pattern.
I think i agree here.


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

https://reviews.llvm.org/D75576





More information about the llvm-commits mailing list