Skip to content

Commit b9f1b8b

Browse files
Revert "Support repeated machine outlining"
This reverts commit 1f93b16.
1 parent 76cf140 commit b9f1b8b

File tree

2 files changed

+3
-192
lines changed

2 files changed

+3
-192
lines changed

llvm/lib/CodeGen/MachineOutliner.cpp

Lines changed: 3 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,6 @@ static cl::opt<bool> EnableLinkOnceODROutlining(
9797
cl::desc("Enable the machine outliner on linkonceodr functions"),
9898
cl::init(false));
9999

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-
107100
namespace {
108101

109102
/// Represents an undefined index in the suffix tree.
@@ -849,9 +842,6 @@ struct MachineOutliner : public ModulePass {
849842
/// linkonceodr linkage.
850843
bool OutlineFromLinkOnceODRs = false;
851844

852-
/// The current repeat number of machine outlining.
853-
unsigned OutlineRepeatedNum = 0;
854-
855845
/// Set to true if the outliner should run on all functions in the module
856846
/// considered safe for outlining.
857847
/// Set to true by default for compatibility with llc's -run-pass option.
@@ -910,11 +900,8 @@ struct MachineOutliner : public ModulePass {
910900
InstructionMapper &Mapper,
911901
unsigned Name);
912902

913-
/// Calls runOnceOnModule NumRepeat times
914-
bool runOnModule(Module &M) override;
915-
916903
/// Calls 'doOutline()'.
917-
bool runOnceOnModule(Module &M, unsigned Iter);
904+
bool runOnModule(Module &M) override;
918905

919906
/// Construct a suffix tree on the instructions in \p M and outline repeated
920907
/// strings from that tree.
@@ -1112,13 +1099,7 @@ MachineFunction *MachineOutliner::createOutlinedFunction(
11121099
// Create the function name. This should be unique.
11131100
// FIXME: We should have a better naming scheme. This should be stable,
11141101
// 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();
11221103

11231104
// Create the function using an IR-level function.
11241105
LLVMContext &C = M.getContext();
@@ -1457,14 +1438,12 @@ void MachineOutliner::emitInstrCountChangedRemark(
14571438
}
14581439
}
14591440

1460-
bool MachineOutliner::runOnceOnModule(Module &M, unsigned Iter) {
1441+
bool MachineOutliner::runOnModule(Module &M) {
14611442
// Check if there's anything in the module. If it's empty, then there's
14621443
// nothing to outline.
14631444
if (M.empty())
14641445
return false;
14651446

1466-
OutlineRepeatedNum = Iter;
1467-
14681447
// Number to append to the current outlined function.
14691448
unsigned OutlinedFunctionNum = 0;
14701449

@@ -1528,23 +1507,3 @@ bool MachineOutliner::doOutline(Module &M, unsigned &OutlinedFunctionNum) {
15281507

15291508
return OutlinedSomething;
15301509
}
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-
}

llvm/test/CodeGen/AArch64/machine-outliner-iterative.mir

Lines changed: 0 additions & 148 deletions
This file was deleted.

0 commit comments

Comments
 (0)