Skip to content

Commit 6db0c7d

Browse files
committed
Comments
1 parent 14f23a5 commit 6db0c7d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

clang/lib/Driver/ToolChains/AMDGPU.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -712,14 +712,14 @@ void amdgpu::getAMDGPUTargetFeatures(const Driver &D,
712712
options::OPT_m_amdgpu_Features_Group);
713713
}
714714

715-
static unsigned GetFullLTOPartitions(const Driver &D, const ArgList &Args) {
715+
static unsigned getFullLTOPartitions(const Driver &D, const ArgList &Args) {
716716
const Arg *A = Args.getLastArg(options::OPT_flto_partitions_EQ);
717717
// In the absence of an option, use the number of available threads with a cap
718718
// at 16 partitions. More than 16 partitions rarely benefits code splitting
719719
// and can lead to more empty/small modules each with their own overhead.
720720
if (!A)
721721
return std::min(16u, llvm::hardware_concurrency().compute_thread_count());
722-
int Value;
722+
int Value = 0;
723723
if (StringRef(A->getValue()).getAsInteger(10, Value) || (Value < 1)) {
724724
D.Diag(diag::err_drv_invalid_int_value)
725725
<< A->getAsString(Args) << A->getValue();
@@ -732,9 +732,10 @@ static unsigned GetFullLTOPartitions(const Driver &D, const ArgList &Args) {
732732
void amdgpu::addFullLTOPartitionOption(const Driver &D,
733733
const llvm::opt::ArgList &Args,
734734
llvm::opt::ArgStringList &CmdArgs) {
735-
// TODO: restrict to gpu-rdc only?
735+
// TODO: Should this be restricted to fgpu-rdc only ? Currently we'll
736+
// also do it for non gpu-rdc LTO
736737

737-
if (unsigned NumParts = GetFullLTOPartitions(D, Args); NumParts > 1) {
738+
if (unsigned NumParts = getFullLTOPartitions(D, Args); NumParts > 1) {
738739
CmdArgs.push_back(
739740
Args.MakeArgString("--lto-partitions=" + Twine(NumParts)));
740741
}

0 commit comments

Comments
 (0)