[PATCH] D72643: [InstCombine] form copysign from select of FP constants (PR44153)

Dávid Bolvanský via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 16 11:39:33 PST 2020


xbolva00 added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp:2331
+  if (!match(TVal, m_APFloat(TC)) || !match(FVal, m_APFloat(FC)) ||
+      !abs(*TC).bitwiseIsEqual(abs(*FC)) || TC == FC)
+    return nullptr;
----------------
spatel wrote:
> nick wrote:
> > I would never expect `TC == FC` to happen here. Are branches folded later than this transform?
> We have to look at this 'select' independently of any other instruction because of the way instcombine processes. But I think you're correct that we can assume TC != FC because that should be simplified before we reach here. I will change that to an assert.
+1 for assert


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

https://reviews.llvm.org/D72643





More information about the llvm-commits mailing list