From: Sanjay Patel Date: Sat, 6 Nov 2021 13:34:30 +0000 (-0400) Subject: [DAGCombiner] remove vselect fold that was accidentally added X-Git-Tag: upstream/15.0.7~26552 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=39c4c7d3912a6759e537e03ed334451e9f96e9ad;p=platform%2Fupstream%2Fllvm.git [DAGCombiner] remove vselect fold that was accidentally added This diff snuck into the unrelated: 025a2f73a319 It's a suggested follow-up for D113212, but I need to add test coverage first. --- diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 7888712..07a2ac8 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -9575,23 +9575,6 @@ static SDValue foldVSelectToSignBitSplatMask(SDNode *N, SelectionDAG &DAG) { return DAG.getNode(ISD::OR, DL, VT, Sra, N2); } - // If the comparison is testing for a positive value, we have to invert - // the sign bit mask, so only do that transform if the target has a bitwise - // 'and not' instruction (the invert is free). - // (Cond0 s> -1) ? N1 : 0 --> ~(Cond0 s>> BW-1) & N1 - const TargetLowering &TLI = DAG.getTargetLoweringInfo(); - if (CC == ISD::SETGT && isAllOnesOrAllOnesSplat(Cond1) && - isNullOrNullSplat(N2) && TLI.hasAndNot(N2)) { - SDLoc DL(N); - SDValue ShiftAmt = DAG.getConstant(VT.getScalarSizeInBits() - 1, DL, VT); - SDValue Sra = DAG.getNode(ISD::SRA, DL, VT, Cond0, ShiftAmt); - SDValue Not = DAG.getNOT(DL, Sra, VT); - return DAG.getNode(ISD::AND, DL, VT, Not, N1); - } - // (X > 0) ? X : 0 <-- This is canonical signed max. -// if (!(isAllOnesConstant(N1) || (isNullConstant(N1) && N0 == N2))) -// return SDValue(); - return SDValue(); }