[llvm] r342149 - [InstCombine] remove checks for IsFreeToInvert()

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 13 09:18:12 PDT 2018


Author: spatel
Date: Thu Sep 13 09:18:12 2018
New Revision: 342149

URL: http://llvm.org/viewvc/llvm-project?rev=342149&view=rev
Log:
[InstCombine] remove checks for IsFreeToInvert()

I accidentally committed this diff with rL342147 because
I had applied D51964. We probably do need those checks,
but D51964 has tests and more discussion/motivation,
so they should be re-added with that patch.

Modified:
    llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp

Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp?rev=342149&r1=342148&r2=342149&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp Thu Sep 13 09:18:12 2018
@@ -1847,9 +1847,7 @@ Instruction *InstCombiner::visitSelectIn
       // MIN(~a, ~b) -> ~MAX(a, b)
       Value *A, *B;
       if (match(LHS, m_Not(m_Value(A))) && match(RHS, m_Not(m_Value(B))) &&
-          !IsFreeToInvert(A, A->hasOneUse()) &&
-          !IsFreeToInvert(B, B->hasOneUse()) &&
-         (!LHS->hasNUsesOrMore(3) || !RHS->hasNUsesOrMore(3))) {
+          (!LHS->hasNUsesOrMore(3) || !RHS->hasNUsesOrMore(3))) {
         CmpInst::Predicate InvertedPred = getInverseMinMaxPred(SPF);
         Value *InvertedCmp = Builder.CreateICmp(InvertedPred, A, B);
         Value *NewSel = Builder.CreateSelect(InvertedCmp, A, B);




More information about the llvm-commits mailing list