Skip to content

Commit 90dde92

Browse files
committed
Address comments
Signed-off-by: John Lu <[email protected]>
1 parent 5099306 commit 90dde92

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4097,7 +4097,7 @@ SDValue AMDGPUTargetLowering::performShlCombine(SDNode *N,
40974097
if (VT.getScalarType() != MVT::i64)
40984098
return SDValue();
40994099

4100-
// i64 (shl x, C) -> (build_pair 0, (shl x, C -32))
4100+
// i64 (shl x, C) -> (build_pair 0, (shl x, C - 32))
41014101

41024102
// On some subtargets, 64-bit shift is a quarter rate instruction. In the
41034103
// common case, splitting this into a move and a 32-bit shift is faster and
@@ -4117,12 +4117,12 @@ SDValue AMDGPUTargetLowering::performShlCombine(SDNode *N,
41174117
ShiftAmt = DAG.getConstant(RHSVal - TargetScalarType.getSizeInBits(), SL,
41184118
TargetType);
41194119
} else {
4120-
SDValue truncShiftAmt = DAG.getNode(ISD::TRUNCATE, SL, TargetType, RHS);
4120+
SDValue TruncShiftAmt = DAG.getNode(ISD::TRUNCATE, SL, TargetType, RHS);
41214121
const SDValue ShiftMask =
41224122
DAG.getConstant(TargetScalarType.getSizeInBits() - 1, SL, TargetType);
41234123
// This AND instruction will clamp out of bounds shift values.
41244124
// It will also be removed during later instruction selection.
4125-
ShiftAmt = DAG.getNode(ISD::AND, SL, TargetType, truncShiftAmt, ShiftMask);
4125+
ShiftAmt = DAG.getNode(ISD::AND, SL, TargetType, TruncShiftAmt, ShiftMask);
41264126
}
41274127

41284128
SDValue Lo = DAG.getNode(ISD::TRUNCATE, SL, TargetType, LHS);
@@ -4233,12 +4233,12 @@ SDValue AMDGPUTargetLowering::performSrlCombine(SDNode *N,
42334233
ShiftAmt = DAG.getConstant(RHSVal - TargetScalarType.getSizeInBits(), SL,
42344234
TargetType);
42354235
} else {
4236-
SDValue truncShiftAmt = DAG.getNode(ISD::TRUNCATE, SL, TargetType, RHS);
4236+
SDValue TruncShiftAmt = DAG.getNode(ISD::TRUNCATE, SL, TargetType, RHS);
42374237
const SDValue ShiftMask =
42384238
DAG.getConstant(TargetScalarType.getSizeInBits() - 1, SL, TargetType);
42394239
// This AND instruction will clamp out of bounds shift values.
42404240
// It will also be removed during later instruction selection.
4241-
ShiftAmt = DAG.getNode(ISD::AND, SL, TargetType, truncShiftAmt, ShiftMask);
4241+
ShiftAmt = DAG.getNode(ISD::AND, SL, TargetType, TruncShiftAmt, ShiftMask);
42424242
}
42434243

42444244
const SDValue Zero = DAG.getConstant(0, SL, TargetScalarType);
@@ -4253,10 +4253,9 @@ SDValue AMDGPUTargetLowering::performSrlCombine(SDNode *N,
42534253
SmallVector<SDValue, 8> HiOps(NElts);
42544254
SmallVector<SDValue, 16> HiAndLoOps;
42554255

4256-
DAG.ExtractVectorElements(SplitLHS, HiAndLoOps, 0, NElts * 2);
4257-
for (unsigned I = 0; I != NElts; ++I) {
4256+
DAG.ExtractVectorElements(SplitLHS, HiAndLoOps, /*Start=*/0, NElts * 2);
4257+
for (unsigned I = 0; I != NElts; ++I)
42584258
HiOps[I] = HiAndLoOps[2 * I + 1];
4259-
}
42604259
Hi = DAG.getNode(ISD::BUILD_VECTOR, LHSSL, TargetType, HiOps);
42614260
} else {
42624261
const SDValue One = DAG.getConstant(1, LHSSL, TargetScalarType);

0 commit comments

Comments
 (0)