[PATCH] D72643: [InstCombine] form copysign from select of FP constants (PR44153)
Nikita Kniazev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 13 14:30:23 PST 2020
nick added a comment.
I cannot be a reviewer, just added some dummies questions. And, @spatel, thanks for working on this!
================
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;
----------------
I would never expect `TC == FC` to happen here. Are branches folded later than this transform?
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp:2338
+ ICmpInst::Predicate Pred;
+ if (!match(Cond, m_OneUse(m_ICmp(Pred, m_BitCast(m_Value(X)), m_APInt(C)))) ||
+ !isSignBitCheck(Pred, *C, IsTrueIfSignSet) || X->getType() != SelType)
----------------
Is the one use check necessary? I would imagine that this transform will unblock other one use transforms.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D72643/new/
https://reviews.llvm.org/D72643
More information about the llvm-commits
mailing list