[DAGCombine] visitVSELECT - use getShiftAmountTy for shift amounts.

llvm-svn: 370471
This commit is contained in:
Simon Pilgrim 2019-08-30 13:30:37 +00:00
parent 8e1989e79a
commit 3367669668
1 changed files with 3 additions and 3 deletions

View File

@ -8715,9 +8715,9 @@ SDValue DAGCombiner::visitVSELECT(SDNode *N) {
if (TLI.isOperationLegalOrCustom(ISD::ABS, VT)) if (TLI.isOperationLegalOrCustom(ISD::ABS, VT))
return DAG.getNode(ISD::ABS, DL, VT, LHS); return DAG.getNode(ISD::ABS, DL, VT, LHS);
SDValue Shift = DAG.getNode( SDValue Shift = DAG.getNode(ISD::SRA, DL, VT, LHS,
ISD::SRA, DL, VT, LHS, DAG.getConstant(VT.getScalarSizeInBits() - 1,
DAG.getConstant(VT.getScalarSizeInBits() - 1, DL, VT)); DL, getShiftAmountTy(VT)));
SDValue Add = DAG.getNode(ISD::ADD, DL, VT, LHS, Shift); SDValue Add = DAG.getNode(ISD::ADD, DL, VT, LHS, Shift);
AddToWorklist(Shift.getNode()); AddToWorklist(Shift.getNode());
AddToWorklist(Add.getNode()); AddToWorklist(Add.getNode());