[PATCH] D65954: [Reassociate] try harder to convert negative FP constants to positive

Michael Berg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 8 10:55:32 PDT 2019


mcberg2017 added a comment.

I worked through some of the tests, but would like another set of eyes to verify.  Doing a quick internal validation with this for regressions.



================
Comment at: llvm/lib/Transforms/Scalar/Reassociate.cpp:2014
+    if (match(Negatible->getOperand(0), m_APFloat(C))) {
+      assert(!match(Negatible->getOperand(1), m_Constant()) &&
+             "Expecting only 1 constant operand");
----------------
mcberg2017 wrote:
> How about in place of the assert, logic to bypass candidates that meet these constraints.  It should not happen given how the candidate list is built, however this would ensure if something did get in we would not process it for release builds.
Actually this is fine as it is...


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

https://reviews.llvm.org/D65954





More information about the llvm-commits mailing list