[PATCH] D75467: [instcombine] remove fsub to fneg hacks; only emit fneg

Cameron McInally via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 2 10:20:58 PST 2020


cameron.mcinally added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp:2137
+  if (match(&I, m_FNeg(m_Value(Op))))
+    return UnaryOperator::CreateFNegFMF(Op, &I);
 
----------------
Just noticed that this is a bug -- it needs a guard for denormal flushing. 

When FTZ or DAZ:
  fsub -0.0, Denorm ==> +-0
  fneg Denorm ==> -Denorm

Handling denormals correctly is an ongoing project. If you'd like to leave this for later, we'll get to it. I see that it's currently broken, so no harm in continuing that way for now.

Could you add a brief FIXME here?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75467





More information about the llvm-commits mailing list