Skip to content

Commit ae399f7

Browse files
Address review feedback: Add periods to all comments
As requested by @cdevadas, all comments in the mbcnt optimization functions now end with a period for consistency with LLVM style. Note: The use of 'auto' keyword was defended by @krzysz00 as these appear next to dyn_cast<> which already includes the type information, following common LLVM patterns.
1 parent 4f0dadf commit ae399f7

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2120,17 +2120,17 @@ INITIALIZE_PASS_END(AMDGPUCodeGenPrepare, DEBUG_TYPE, "AMDGPU IR optimizations",
21202120
false, false)
21212121

21222122
bool AMDGPUCodeGenPrepareImpl::visitMbcntLo(IntrinsicInst &I) {
2123-
// On wave32 targets, mbcnt.lo(~0, 0) can be replaced with workitem.id.x
2123+
// On wave32 targets, mbcnt.lo(~0, 0) can be replaced with workitem.id.x.
21242124
if (!ST.isWave32())
21252125
return false;
21262126

2127-
// Check for pattern mbcnt.lo(~0, 0)
2127+
// Check for pattern mbcnt.lo(~0, 0).
21282128
auto *Arg0C = dyn_cast<ConstantInt>(I.getArgOperand(0));
21292129
auto *Arg1C = dyn_cast<ConstantInt>(I.getArgOperand(1));
21302130
if (!Arg0C || !Arg1C || !Arg0C->isAllOnesValue() || !Arg1C->isZero())
21312131
return false;
21322132

2133-
// Check reqd_work_group_size similar to mbcnt_hi case
2133+
// Check reqd_work_group_size similar to mbcnt_hi case.
21342134
Function *F = I.getFunction();
21352135
if (!F)
21362136
return false;
@@ -2154,8 +2154,8 @@ bool AMDGPUCodeGenPrepareImpl::visitMbcntLo(IntrinsicInst &I) {
21542154
I.eraseFromParent();
21552155
return true;
21562156
}
2157-
// Handle bitmask case: when X dimension evenly splits into waves
2158-
// mbcnt.lo(~0, 0) = workitem.id.x() & (wave_size - 1)
2157+
// Handle bitmask case: when X dimension evenly splits into waves.
2158+
// mbcnt.lo(~0, 0) = workitem.id.x() & (wave_size - 1).
21592159
if (ST.hasWavefrontsEvenlySplittingXDim(*F, /*RequiresUniformYZ=*/true)) {
21602160
if (Wave != 0 && isPowerOf2_32(Wave)) {
21612161
IRBuilder<> B(&I);
@@ -2165,7 +2165,7 @@ bool AMDGPUCodeGenPrepareImpl::visitMbcntLo(IntrinsicInst &I) {
21652165
Constant *Mask = ConstantInt::get(ITy, Wave - 1);
21662166
Instruction *AndInst = cast<Instruction>(B.CreateAnd(Tid, Mask));
21672167
AndInst->takeName(&I);
2168-
// Note: Range metadata cannot be applied to 'and' instructions
2168+
// Note: Range metadata cannot be applied to 'and' instructions.
21692169
I.replaceAllUsesWith(AndInst);
21702170
I.eraseFromParent();
21712171
return true;
@@ -2201,7 +2201,7 @@ bool AMDGPUCodeGenPrepareImpl::visitMbcntHi(IntrinsicInst &I) {
22012201
}
22022202
}
22032203

2204-
// Pattern: mbcnt.hi(~0, mbcnt.lo(~0, 0))
2204+
// Pattern: mbcnt.hi(~0, mbcnt.lo(~0, 0)).
22052205
auto *HiArg1 = dyn_cast<CallInst>(I.getArgOperand(1));
22062206
if (!HiArg1)
22072207
return false;
@@ -2210,12 +2210,12 @@ bool AMDGPUCodeGenPrepareImpl::visitMbcntHi(IntrinsicInst &I) {
22102210
if (!CalledF || CalledF->getIntrinsicID() != Intrinsic::amdgcn_mbcnt_lo)
22112211
return false;
22122212

2213-
// hi arg0 must be all-ones
2213+
// hi arg0 must be all-ones.
22142214
auto *HiArg0C = dyn_cast<ConstantInt>(I.getArgOperand(0));
22152215
if (!HiArg0C || !HiArg0C->isAllOnesValue())
22162216
return false;
22172217

2218-
// lo args: arg0 == ~0, arg1 == 0
2218+
// lo args: arg0 == ~0, arg1 == 0.
22192219
Value *Lo0 = HiArg1->getArgOperand(0);
22202220
Value *Lo1 = HiArg1->getArgOperand(1);
22212221
auto *Lo0C = dyn_cast<ConstantInt>(Lo0);

0 commit comments

Comments
 (0)