forked from OSchip/llvm-project
[DAGCombine] visitVSELECT - use getShiftAmountTy for shift amounts.
llvm-svn: 370471
This commit is contained in:
parent
8e1989e79a
commit
3367669668
|
@ -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());
|
||||||
|
|
Loading…
Reference in New Issue