Skip to content

Commit 6d8cae7

Browse files
committed
[X86] LowerShift - use DAG::getNegative() helper. NFC.
1 parent b7248d5 commit 6d8cae7

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29374,10 +29374,8 @@ static SDValue LowerShift(SDValue Op, const X86Subtarget &Subtarget,
2937429374
// +ve/-ve Amt = shift left/right.
2937529375
if (Subtarget.hasXOP() && (VT == MVT::v2i64 || VT == MVT::v4i32 ||
2937629376
VT == MVT::v8i16 || VT == MVT::v16i8)) {
29377-
if (Opc == ISD::SRL || Opc == ISD::SRA) {
29378-
SDValue Zero = DAG.getConstant(0, dl, VT);
29379-
Amt = DAG.getNode(ISD::SUB, dl, VT, Zero, Amt);
29380-
}
29377+
if (Opc == ISD::SRL || Opc == ISD::SRA)
29378+
Amt = DAG.getNegative(Amt, dl, VT);
2938129379
if (Opc == ISD::SHL || Opc == ISD::SRL)
2938229380
return DAG.getNode(X86ISD::VPSHL, dl, VT, R, Amt);
2938329381
if (Opc == ISD::SRA)

0 commit comments

Comments
 (0)