Skip to content

Commit

Permalink
[X86] LowerShift - use DAG::getNegative() helper. NFC.
Browse files Browse the repository at this point in the history
  • Loading branch information
RKSimon committed Apr 29, 2024
1 parent b7248d5 commit 6d8cae7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions llvm/lib/Target/X86/X86ISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29374,10 +29374,8 @@ static SDValue LowerShift(SDValue Op, const X86Subtarget &Subtarget,
// +ve/-ve Amt = shift left/right.
if (Subtarget.hasXOP() && (VT == MVT::v2i64 || VT == MVT::v4i32 ||
VT == MVT::v8i16 || VT == MVT::v16i8)) {
if (Opc == ISD::SRL || Opc == ISD::SRA) {
SDValue Zero = DAG.getConstant(0, dl, VT);
Amt = DAG.getNode(ISD::SUB, dl, VT, Zero, Amt);
}
if (Opc == ISD::SRL || Opc == ISD::SRA)
Amt = DAG.getNegative(Amt, dl, VT);
if (Opc == ISD::SHL || Opc == ISD::SRL)
return DAG.getNode(X86ISD::VPSHL, dl, VT, R, Amt);
if (Opc == ISD::SRA)
Expand Down

0 comments on commit 6d8cae7

Please sign in to comment.