Skip to content

Commit 626cb4f

Browse files
committed
Move comment
1 parent 158fc6d commit 626cb4f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9266,7 +9266,6 @@ SDValue TargetLowering::expandAVG(SDNode *N, SelectionDAG &DAG) const {
92669266
}
92679267

92689268
// For scalars, see if we can efficiently extend/truncate to use add+shift.
9269-
// We can always use SRL as we will be truncating away the extended sign bits.
92709269
if (VT.isScalarInteger()) {
92719270
unsigned BW = VT.getScalarSizeInBits();
92729271
EVT ExtVT = VT.getIntegerVT(*DAG.getContext(), 2 * BW);
@@ -9277,6 +9276,7 @@ SDValue TargetLowering::expandAVG(SDNode *N, SelectionDAG &DAG) const {
92779276
if (!IsFloor)
92789277
Avg = DAG.getNode(ISD::ADD, dl, ExtVT, Avg,
92799278
DAG.getConstant(1, dl, ExtVT));
9279+
// Just use SRL as we will be truncating away the extended sign bits.
92809280
Avg = DAG.getNode(ISD::SRL, dl, ExtVT, Avg,
92819281
DAG.getShiftAmountConstant(1, ExtVT, dl));
92829282
return DAG.getNode(ISD::TRUNCATE, dl, VT, Avg);

0 commit comments

Comments
 (0)