Skip to content

Commit c0b4df4

Browse files
committed
[BOLT] Remove workaround
Remove the workaround for the issue that was fixed in #160263.
1 parent 35cf13d commit c0b4df4

File tree

2 files changed

+16
-32
lines changed

2 files changed

+16
-32
lines changed

bolt/lib/Passes/InsertNegateRAStatePass.cpp

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -126,26 +126,15 @@ Error InsertNegateRAState::runOnFunctions(BinaryContext &BC) {
126126
return !BF.containedNegateRAState() || BF.isIgnored();
127127
};
128128

129-
int Total = llvm::count_if(
130-
BC.getBinaryFunctions(),
131-
[&](std::pair<const unsigned long, BinaryFunction> &P) {
132-
return P.second.containedNegateRAState() && !P.second.isIgnored();
133-
});
134-
135-
// If we attempt to run the pass, but SkipPredicate skips all functions,
136-
// we get a warning that the SchedulingPolicy is changed to trivial.
137-
// This would break bolt/test/AArch64/unmarked-data.test.
138-
if (Total != 0) {
139-
ParallelUtilities::runOnEachFunction(
140-
BC, ParallelUtilities::SchedulingPolicy::SP_INST_LINEAR, WorkFun,
141-
SkipPredicate, "InsertNegateRAStatePass");
142-
143-
BC.outs() << "BOLT-INFO: rewritten pac-ret DWARF info in "
144-
<< FunctionsModified << " out of "
145-
<< BC.getBinaryFunctions().size() << " functions "
146-
<< format("(%.2lf%%).\n", (100.0 * FunctionsModified) /
147-
BC.getBinaryFunctions().size());
148-
}
129+
ParallelUtilities::runOnEachFunction(
130+
BC, ParallelUtilities::SchedulingPolicy::SP_INST_LINEAR, WorkFun,
131+
SkipPredicate, "InsertNegateRAStatePass");
132+
133+
BC.outs() << "BOLT-INFO: rewritten pac-ret DWARF info in "
134+
<< FunctionsModified << " out of " << BC.getBinaryFunctions().size()
135+
<< " functions "
136+
<< format("(%.2lf%%).\n", (100.0 * FunctionsModified) /
137+
BC.getBinaryFunctions().size());
149138
return Error::success();
150139
}
151140

bolt/lib/Passes/MarkRAStates.cpp

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -137,18 +137,13 @@ Error MarkRAStates::runOnFunctions(BinaryContext &BC) {
137137
return P.second.containedNegateRAState() && !P.second.isIgnored();
138138
});
139139

140-
// If we attempt to run the pass, but SkipPredicate skips all functions,
141-
// we get a warning that the SchedulingPolicy is changed to trivial.
142-
// This would break bolt/test/AArch64/unmarked-data.test.
143-
if (Total != 0) {
144-
ParallelUtilities::runOnEachFunction(
145-
BC, ParallelUtilities::SchedulingPolicy::SP_INST_LINEAR, WorkFun,
146-
SkipPredicate, "MarkRAStates");
147-
BC.outs() << "BOLT-INFO: MarkRAStates ran on " << Total
148-
<< " functions. Ignored " << FunctionsIgnored << " functions "
149-
<< format("(%.2lf%%)", (100.0 * FunctionsIgnored) / Total)
150-
<< " because of CFI inconsistencies\n";
151-
}
140+
ParallelUtilities::runOnEachFunction(
141+
BC, ParallelUtilities::SchedulingPolicy::SP_INST_LINEAR, WorkFun,
142+
SkipPredicate, "MarkRAStates");
143+
BC.outs() << "BOLT-INFO: MarkRAStates ran on " << Total
144+
<< " functions. Ignored " << FunctionsIgnored << " functions "
145+
<< format("(%.2lf%%)", (100.0 * FunctionsIgnored) / Total)
146+
<< " because of CFI inconsistencies\n";
152147

153148
return Error::success();
154149
}

0 commit comments

Comments
 (0)