Skip to content

Commit 0a6b73b

Browse files
committed
[BOLT][NFC] Don't remove nops in non-simple functions
Follow the logic of https://reviews.llvm.org/D143887 patch (fixed later by llvm#71377) we don't want to remove nops in non-simple function just in case there is undetected jump table to minimize chances to break offsets in it.
1 parent 0954205 commit 0a6b73b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bolt/lib/Passes/BinaryPasses.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1923,7 +1923,7 @@ Error RemoveNops::runOnFunctions(BinaryContext &BC) {
19231923
};
19241924

19251925
ParallelUtilities::PredicateTy SkipFunc = [&](const BinaryFunction &BF) {
1926-
return BF.shouldPreserveNops();
1926+
return BF.shouldPreserveNops() || (!opts::StrictMode && !BF.isSimple());
19271927
};
19281928

19291929
ParallelUtilities::runOnEachFunction(

0 commit comments

Comments
 (0)