@@ -97,13 +97,6 @@ static cl::opt<bool> EnableLinkOnceODROutlining(
97
97
cl::desc (" Enable the machine outliner on linkonceodr functions" ),
98
98
cl::init(false ));
99
99
100
- // Set the number of times to repeatedly apply outlining.
101
- // Defaults to 1, but more repetitions can save additional size.
102
- static cl::opt<unsigned >
103
- NumRepeat (" machine-outline-runs" , cl::Hidden,
104
- cl::desc (" The number of times to apply machine outlining" ),
105
- cl::init(1 ));
106
-
107
100
namespace {
108
101
109
102
// / Represents an undefined index in the suffix tree.
@@ -849,9 +842,6 @@ struct MachineOutliner : public ModulePass {
849
842
// / linkonceodr linkage.
850
843
bool OutlineFromLinkOnceODRs = false ;
851
844
852
- // / The current repeat number of machine outlining.
853
- unsigned OutlineRepeatedNum = 0 ;
854
-
855
845
// / Set to true if the outliner should run on all functions in the module
856
846
// / considered safe for outlining.
857
847
// / Set to true by default for compatibility with llc's -run-pass option.
@@ -910,11 +900,8 @@ struct MachineOutliner : public ModulePass {
910
900
InstructionMapper &Mapper,
911
901
unsigned Name);
912
902
913
- // / Calls runOnceOnModule NumRepeat times
914
- bool runOnModule (Module &M) override ;
915
-
916
903
// / Calls 'doOutline()'.
917
- bool runOnceOnModule (Module &M, unsigned Iter) ;
904
+ bool runOnModule (Module &M) override ;
918
905
919
906
// / Construct a suffix tree on the instructions in \p M and outline repeated
920
907
// / strings from that tree.
@@ -1112,13 +1099,7 @@ MachineFunction *MachineOutliner::createOutlinedFunction(
1112
1099
// Create the function name. This should be unique.
1113
1100
// FIXME: We should have a better naming scheme. This should be stable,
1114
1101
// regardless of changes to the outliner's cost model/traversal order.
1115
- std::string FunctionName;
1116
- if (OutlineRepeatedNum > 0 )
1117
- FunctionName = (" OUTLINED_FUNCTION_" + Twine (OutlineRepeatedNum + 1 ) + " _" +
1118
- Twine (Name))
1119
- .str ();
1120
- else
1121
- FunctionName = (" OUTLINED_FUNCTION_" + Twine (Name)).str ();
1102
+ std::string FunctionName = (" OUTLINED_FUNCTION_" + Twine (Name)).str ();
1122
1103
1123
1104
// Create the function using an IR-level function.
1124
1105
LLVMContext &C = M.getContext ();
@@ -1457,14 +1438,12 @@ void MachineOutliner::emitInstrCountChangedRemark(
1457
1438
}
1458
1439
}
1459
1440
1460
- bool MachineOutliner::runOnceOnModule (Module &M, unsigned Iter ) {
1441
+ bool MachineOutliner::runOnModule (Module &M) {
1461
1442
// Check if there's anything in the module. If it's empty, then there's
1462
1443
// nothing to outline.
1463
1444
if (M.empty ())
1464
1445
return false ;
1465
1446
1466
- OutlineRepeatedNum = Iter;
1467
-
1468
1447
// Number to append to the current outlined function.
1469
1448
unsigned OutlinedFunctionNum = 0 ;
1470
1449
@@ -1528,23 +1507,3 @@ bool MachineOutliner::doOutline(Module &M, unsigned &OutlinedFunctionNum) {
1528
1507
1529
1508
return OutlinedSomething;
1530
1509
}
1531
-
1532
- // Apply machine outlining for NumRepeat times.
1533
- bool MachineOutliner::runOnModule (Module &M) {
1534
- if (NumRepeat < 1 )
1535
- report_fatal_error (" Expect NumRepeat for machine outlining "
1536
- " to be greater than or equal to 1!\n " );
1537
-
1538
- bool Changed = false ;
1539
- for (unsigned I = 0 ; I < NumRepeat; I++) {
1540
- if (!runOnceOnModule (M, I)) {
1541
- LLVM_DEBUG (dbgs () << " Stopped outlining at iteration " << I
1542
- << " because no changes were found.\n " ;);
1543
- return Changed;
1544
- }
1545
- Changed = true ;
1546
- }
1547
- LLVM_DEBUG (dbgs () << " Stopped outlining because iteration is "
1548
- " equal to " << NumRepeat << " \n " ;);
1549
- return Changed;
1550
- }
0 commit comments