From: Chandler Carruth Date: Thu, 19 Feb 2015 11:43:37 +0000 (+0000) Subject: [x86] The SELECT x86 DAG combine also does legalization. It used to rely X-Git-Tag: llvmorg-3.7.0-rc1~11507 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=38dea42ddfb77c69615041b7c39bcb2353a5e3e3;p=platform%2Fupstream%2Fllvm.git [x86] The SELECT x86 DAG combine also does legalization. It used to rely on things not being marked as either custom or legal, but we now do custom lowering of more VSELECT nodes. To cope with this, manually replicate the legality tests here. These have to stay in sync with the set of tests used in the custom lowering of VSELECT. Ideally, we wouldn't do any of this combine-based-legalization when we have an actual custom legalization step for VSELECT, but I'm not going to be able to rewrite all of that today. I don't have a test case for this currently, but it was found when compiling a number of the test-suite benchmarks. I'll try to reduce a test case and add it. This should at least fix the test-suite fallout on build bots. llvm-svn: 229844 --- diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index d242597..7e5fa84 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -24015,12 +24015,12 @@ static SDValue PerformSELECTCombine(SDNode *N, SelectionDAG &DAG, // to simplify previous instructions. if (N->getOpcode() == ISD::VSELECT && DCI.isBeforeLegalizeOps() && !DCI.isBeforeLegalize() && - // We explicitly check against v8i16 and v16i16 because, although - // they're marked as Custom, they might only be legal when Cond is a - // build_vector of constants. This will be taken care in a later - // condition. - (TLI.isOperationLegalOrCustom(ISD::VSELECT, VT) && VT != MVT::v16i16 && - VT != MVT::v8i16) && + // We explicitly check against SSE4.1, v8i16 and v16i16 because, although + // vselect nodes may be marked as Custom, they might only be legal when + // Cond is a build_vector of constants. This will be taken care in + // a later condition. + (TLI.isOperationLegalOrCustom(ISD::VSELECT, VT) && + Subtarget->hasSSE41() && VT != MVT::v16i16 && VT != MVT::v8i16) && // Don't optimize vector of constants. Those are handled by // the generic code and all the bits must be properly set for // the generic optimizer.