forked from OSchip/llvm-project
[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
This commit is contained in:
parent
b81e653dce
commit
38dea42ddf
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue