1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 12:43:36 +01:00

[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
This commit is contained in:
Sanjay Patel 2018-09-13 16:18:12 +00:00
parent 4c6b105d20
commit 5b727d26c7

View File

@ -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);