[X86] combineOrShiftToFunnelShift - use isOperationLegalOrCustom to check FSHL/FSHR support

Remove hard wired legality check.
This commit is contained in:
Simon Pilgrim 2019-10-30 11:39:18 +00:00
parent 26655376fe
commit 81399002ae
1 changed files with 2 additions and 1 deletions

View File

@ -39599,7 +39599,8 @@ static SDValue combineOrShiftToFunnelShift(SDNode *N, SelectionDAG &DAG,
EVT VT = N->getValueType(0);
const TargetLowering &TLI = DAG.getTargetLoweringInfo();
if (VT != MVT::i16 && VT != MVT::i32 && VT != MVT::i64)
if (!TLI.isOperationLegalOrCustom(ISD::FSHL, VT) ||
!TLI.isOperationLegalOrCustom(ISD::FSHR, VT))
return SDValue();
// fold (or (x << c) | (y >> (64 - c))) ==> (shld64 x, y, c)