Skip to content

Commit 5a4b873

Browse files
committed
Avoid auto, as requested
1 parent d3beccf commit 5a4b873

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,14 +1414,15 @@ bool GCNTTIImpl::shouldPrefetchAddressSpace(unsigned AS) const {
14141414
void GCNTTIImpl::collectKernelLaunchBounds(
14151415
const Function &F,
14161416
SmallVectorImpl<std::pair<StringRef, int64_t>> &LB) const {
1417-
auto MaxNumWorkgroups = ST->getMaxNumWorkGroups(F);
1417+
SmallVector<unsigned> MaxNumWorkgroups = ST->getMaxNumWorkGroups(F);
14181418
LB.push_back({"amdgpu-max-num-workgroups[0]", MaxNumWorkgroups[0]});
14191419
LB.push_back({"amdgpu-max-num-workgroups[1]", MaxNumWorkgroups[1]});
14201420
LB.push_back({"amdgpu-max-num-workgroups[2]", MaxNumWorkgroups[2]});
1421-
auto FlatWorkGroupSize = ST->getFlatWorkGroupSizes(F);
1421+
std::pair<unsigned, unsigned> FlatWorkGroupSize =
1422+
ST->getFlatWorkGroupSizes(F);
14221423
LB.push_back({"amdgpu-flat-work-group-size[0]", FlatWorkGroupSize.first});
14231424
LB.push_back({"amdgpu-flat-work-group-size[1]", FlatWorkGroupSize.second});
1424-
auto WavesPerEU = ST->getWavesPerEU(F);
1425+
std::pair<unsigned, unsigned> WavesPerEU = ST->getWavesPerEU(F);
14251426
LB.push_back({"amdgpu-waves-per-eu[0]", WavesPerEU.first});
14261427
LB.push_back({"amdgpu-waves-per-eu[1]", WavesPerEU.second});
14271428
}

llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -447,12 +447,13 @@ void NVPTXTTIImpl::getPeelingPreferences(Loop *L, ScalarEvolution &SE,
447447
void NVPTXTTIImpl::collectKernelLaunchBounds(
448448
const Function &F,
449449
SmallVectorImpl<std::pair<StringRef, int64_t>> &LB) const {
450-
if (auto Val = getMaxClusterRank(F))
450+
std::optional<unsigned> Val;
451+
if ((Val = getMaxClusterRank(F)))
451452
LB.push_back({"maxclusterrank", *Val});
452-
if (auto Val = getMaxNTIDx(F))
453+
if ((Val = getMaxNTIDx(F)))
453454
LB.push_back({"maxntidx", *Val});
454-
if (auto Val = getMaxNTIDy(F))
455+
if ((Val = getMaxNTIDy(F)))
455456
LB.push_back({"maxntidy", *Val});
456-
if (auto Val = getMaxNTIDz(F))
457+
if ((Val = getMaxNTIDz(F)))
457458
LB.push_back({"maxntidz", *Val});
458459
}

0 commit comments

Comments
 (0)