@@ -115,7 +115,6 @@ Compilation::Compilation(DiagnosticEngine &Diags,
115
115
unsigned BatchSeed,
116
116
Optional<unsigned > BatchCount,
117
117
Optional<unsigned > BatchSizeLimit,
118
- bool ForceOneBatchRepartition,
119
118
bool SaveTemps,
120
119
bool ShowDriverTimeCompilation,
121
120
std::unique_ptr<UnifiedStatsReporter> StatsReporter)
@@ -136,7 +135,6 @@ Compilation::Compilation(DiagnosticEngine &Diags,
136
135
BatchSeed(BatchSeed),
137
136
BatchCount(BatchCount),
138
137
BatchSizeLimit(BatchSizeLimit),
139
- ForceOneBatchRepartition(ForceOneBatchRepartition),
140
138
SaveTemps(SaveTemps),
141
139
ShowDriverTimeCompilation(ShowDriverTimeCompilation),
142
140
Stats(std::move(StatsReporter)),
@@ -886,42 +884,6 @@ namespace driver {
886
884
});
887
885
}
888
886
889
- // Due to the multiplication of the number of additional files and the
890
- // number of files in a batch, it's pretty easy to construct too-long
891
- // command lines here, which will then fail to exec. We address this crudely
892
- // by re-forming batches with a finer partition when we overflow.
893
- //
894
- // Now that we're passing OutputFileMaps to frontends, this should never
895
- // happen, but keep this as insurance, because the decision to pass output
896
- // file maps cannot know the exact length of the command line, so may
897
- // possibly fail to use the OutputFileMap.
898
- //
899
- // In order to be able to exercise as much of the code paths as possible,
900
- // take a flag to force a retry, but only once.
901
- bool shouldRetryWithMorePartitions (std::vector<const Job *> const &Batches,
902
- bool &PretendTheCommandLineIsTooLongOnce,
903
- size_t &NumPartitions) {
904
-
905
- // Stop rebatching if we can't subdivide batches any further.
906
- if (NumPartitions > PendingExecution.size ())
907
- return false ;
908
-
909
- for (auto const *B : Batches) {
910
- if (!llvm::sys::commandLineFitsWithinSystemLimits (B->getExecutable (),
911
- B->getArguments ()) ||
912
- PretendTheCommandLineIsTooLongOnce) {
913
- PretendTheCommandLineIsTooLongOnce = false ;
914
- // To avoid redoing the batch loop too many times, repartition pretty
915
- // aggressively by doubling partition count / halving size.
916
- NumPartitions *= 2 ;
917
- LLVM_DEBUG (llvm::dbgs ()
918
- << " Should have used a supplementary output file map.\n " );
919
- return true ;
920
- }
921
- }
922
- return false ;
923
- }
924
-
925
887
// Selects the number of partitions based on the user-provided batch
926
888
// count and/or the number of parallel tasks we can run, subject to a
927
889
// fixed per-batch safety cap, to avoid overcommitting memory.
@@ -1049,28 +1011,19 @@ namespace driver {
1049
1011
size_t NumPartitions = pickNumberOfPartitions ();
1050
1012
CommandSetVector Batchable, NonBatchable;
1051
1013
std::vector<const Job *> Batches;
1052
- bool PretendTheCommandLineIsTooLongOnce =
1053
- Comp.getForceOneBatchRepartition ();
1054
- do {
1055
- // We might be restarting loop; clear these before proceeding.
1056
- Batchable.clear ();
1057
- NonBatchable.clear ();
1058
- Batches.clear ();
1059
1014
1060
- // Split the batchable from non-batchable pending jobs.
1061
- getPendingBatchableJobs (Batchable, NonBatchable);
1015
+ // Split the batchable from non-batchable pending jobs.
1016
+ getPendingBatchableJobs (Batchable, NonBatchable);
1062
1017
1063
- // Partition the batchable jobs into sets.
1064
- BatchPartition Partition (NumPartitions);
1065
- partitionIntoBatches (Batchable.takeVector (), Partition);
1018
+ // Partition the batchable jobs into sets.
1019
+ BatchPartition Partition (NumPartitions);
1020
+ partitionIntoBatches (Batchable.takeVector (), Partition);
1066
1021
1067
- // Construct a BatchJob from each batch in the partition.
1068
- for (auto const &Batch : Partition) {
1069
- formBatchJobFromPartitionBatch (Batches, Batch);
1070
- }
1022
+ // Construct a BatchJob from each batch in the partition.
1023
+ for (auto const &Batch : Partition) {
1024
+ formBatchJobFromPartitionBatch (Batches, Batch);
1025
+ }
1071
1026
1072
- } while (shouldRetryWithMorePartitions (
1073
- Batches, PretendTheCommandLineIsTooLongOnce, NumPartitions));
1074
1027
PendingExecution.clear ();
1075
1028
1076
1029
// Save batches so we can locate and decompose them on task-exit.
0 commit comments