Skip to content

Commit f20a146

Browse files
committed
Remove unnecessary ShiftOp
1 parent 50abee1 commit f20a146

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30983,7 +30983,6 @@ static SDValue LowerShift(SDValue Op, const X86Subtarget &Subtarget,
3098330983
DAG.getConstant(0x00ff, dl, ExtVT));
3098430984
SDValue AmtHi = getTargetVShiftByConstNode(
3098530985
X86ISD::VSRLI, dl, ExtVT, DAG.getBitcast(ExtVT, Amt), 8, DAG);
30986-
unsigned int ShiftOp;
3098730986
switch (Opc) {
3098830987
case ISD::SHL:
3098930988
// Because we shift left, no bits from the high half can influence the low
@@ -30993,15 +30992,13 @@ static SDValue LowerShift(SDValue Op, const X86Subtarget &Subtarget,
3099330992
RLo = DAG.getBitcast(ExtVT, R);
3099430993
RHi = DAG.getNode(ISD::AND, dl, ExtVT, RLo,
3099530994
DAG.getConstant(0xff00, dl, ExtVT));
30996-
ShiftOp = X86ISD::VSHLV;
3099730995
break;
3099830996
case ISD::SRL:
3099930997
// Same idea as above, but this time we need to make sure no low bits of
3100030998
// an odd lane can overflow into high bits of an even lane.
3100130999
RHi = DAG.getBitcast(ExtVT, R);
3100231000
RLo = DAG.getNode(ISD::AND, dl, ExtVT, RHi,
3100331001
DAG.getConstant(0x00ff, dl, ExtVT));
31004-
ShiftOp = X86ISD::VSRLV;
3100531002
break;
3100631003
case ISD::SRA:
3100731004
// For arithmetic right shifts, we want to sign extend each even lane of R
@@ -31011,16 +31008,15 @@ static SDValue LowerShift(SDValue Op, const X86Subtarget &Subtarget,
3101131008
RHi = DAG.getBitcast(ExtVT, R);
3101231009
RLo = getTargetVShiftByConstNode(X86ISD::VSHLI, dl, ExtVT, RHi, 8, DAG);
3101331010
RLo = getTargetVShiftByConstNode(X86ISD::VSRAI, dl, ExtVT, RLo, 8, DAG);
31014-
ShiftOp = X86ISD::VSRAV;
3101531011
break;
3101631012
default:
3101731013
llvm_unreachable("Unexpected Shift Op");
3101831014
}
3101931015

3102031016
SDValue ShiftedLo =
31021-
DAG.getBitcast(VT, DAG.getNode(ShiftOp, dl, ExtVT, RLo, AmtLo));
31017+
DAG.getBitcast(VT, DAG.getNode(Opc, dl, ExtVT, RLo, AmtLo));
3102231018
SDValue ShiftedHi =
31023-
DAG.getBitcast(VT, DAG.getNode(ShiftOp, dl, ExtVT, RHi, AmtHi));
31019+
DAG.getBitcast(VT, DAG.getNode(Opc, dl, ExtVT, RHi, AmtHi));
3102431020

3102531021
// To merge the shifted vectors back together, we select even lanes
3102631022
// from ShiftedLo and odd lanes from ShiftedHi.

0 commit comments

Comments
 (0)