[llvm] [BOLT][AArch64] Fix strict usage during ADR Relax (PR #71377)
Maksim Panchenko via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 12 16:57:24 PST 2024
================
@@ -72,14 +72,17 @@ void ADRRelaxationPass::runOnFunction(BinaryFunction &BF) {
if (It != BB.begin() && BC.MIB->isNoop(*std::prev(It))) {
It = BB.eraseInstruction(std::prev(It));
- } else if (opts::StrictMode && !BF.isSimple()) {
+ } else if (std::next(It) != BB.end() && BC.MIB->isNoop(*std::next(It))) {
+ BB.eraseInstruction(std::next(It));
+ } else if (!opts::StrictMode && !BF.isSimple()) {
----------------
maksfb wrote:
I'm the one to blame for the option name. The idea is that the input binary is built with strict requirements allowing BOLT to optimize more aggressively. The way I see it at the moment, we may get rid of the option in the future. It certainly doesn't make much sense on ARM anyway where we cannot rely on relocations to reconstruct control flow.
https://github.com/llvm/llvm-project/pull/71377
More information about the llvm-commits
mailing list