@@ -712,14 +712,14 @@ void amdgpu::getAMDGPUTargetFeatures(const Driver &D,
712
712
options::OPT_m_amdgpu_Features_Group);
713
713
}
714
714
715
- static unsigned GetFullLTOPartitions (const Driver &D, const ArgList &Args) {
715
+ static unsigned getFullLTOPartitions (const Driver &D, const ArgList &Args) {
716
716
const Arg *A = Args.getLastArg (options::OPT_flto_partitions_EQ);
717
717
// In the absence of an option, use the number of available threads with a cap
718
718
// at 16 partitions. More than 16 partitions rarely benefits code splitting
719
719
// and can lead to more empty/small modules each with their own overhead.
720
720
if (!A)
721
721
return std::min (16u , llvm::hardware_concurrency ().compute_thread_count ());
722
- int Value;
722
+ int Value = 0 ;
723
723
if (StringRef (A->getValue ()).getAsInteger (10 , Value) || (Value < 1 )) {
724
724
D.Diag (diag::err_drv_invalid_int_value)
725
725
<< A->getAsString (Args) << A->getValue ();
@@ -732,9 +732,10 @@ static unsigned GetFullLTOPartitions(const Driver &D, const ArgList &Args) {
732
732
void amdgpu::addFullLTOPartitionOption (const Driver &D,
733
733
const llvm::opt::ArgList &Args,
734
734
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
736
737
737
- if (unsigned NumParts = GetFullLTOPartitions (D, Args); NumParts > 1 ) {
738
+ if (unsigned NumParts = getFullLTOPartitions (D, Args); NumParts > 1 ) {
738
739
CmdArgs.push_back (
739
740
Args.MakeArgString (" --lto-partitions=" + Twine (NumParts)));
740
741
}
0 commit comments