From 37e464876b1d3912d9726a13a3769fa7a74ea4b9 Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Thu, 13 Sep 2018 16:18:12 +0000 Subject: [PATCH] [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. llvm-svn: 342149 --- llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp b/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp index aacb38c..a388269 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp @@ -1847,9 +1847,7 @@ Instruction *InstCombiner::visitSelectInst(SelectInst &SI) { // 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); -- 2.7.4