Skip to content

Commit 7e07c1d

Browse files
committed
[DAG] expandAVG - consistently use getShiftAmountConstant for constant shift amounts. NFC
1 parent 8aeb104 commit 7e07c1d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -9557,13 +9557,13 @@ SDValue TargetLowering::expandAVG(SDNode *N, SelectionDAG &DAG) const {
95579557
SDValue Overflow = UAddWithOverflow.getValue(1);
95589558

95599559
// Right shift the sum by 1
9560-
SDValue One = DAG.getShiftAmountConstant(1, VT, dl);
9561-
SDValue LShrVal = DAG.getNode(ISD::SRL, dl, VT, Sum, One);
9560+
SDValue LShrVal = DAG.getNode(ISD::SRL, dl, VT, Sum,
9561+
DAG.getShiftAmountConstant(1, VT, dl));
95629562

95639563
SDValue ZeroExtOverflow = DAG.getNode(ISD::ANY_EXTEND, dl, VT, Overflow);
9564-
SDValue OverflowShl =
9565-
DAG.getNode(ISD::SHL, dl, VT, ZeroExtOverflow,
9566-
DAG.getConstant(VT.getScalarSizeInBits() - 1, dl, VT));
9564+
SDValue OverflowShl = DAG.getNode(
9565+
ISD::SHL, dl, VT, ZeroExtOverflow,
9566+
DAG.getShiftAmountConstant(VT.getScalarSizeInBits() - 1, VT, dl));
95679567

95689568
return DAG.getNode(ISD::OR, dl, VT, LShrVal, OverflowShl);
95699569
}

0 commit comments

Comments
 (0)