[llvm] [BOLT][AArch64] Support FEAT_CMPBR branch instructions. (PR #174972)
Paschalis Mpeis via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 3 08:56:54 PST 2026
paschalis-mpeis wrote:
> If I add `!opts::CompactCodeModel` to the early exit condition then all the non-compact code examples fail. These are the non-relocs test, which exercises the branch inversion, and the new test I've added, which exercises the `adrp` instructions.
I think we could focus this patch on compact-mode for now, disallowing the non-compact path with the above.
The branch inversion tests could be reintroduced in a follow-up patch focused on enabling non-compact mode support, if we decide to support that path as well. Such a patch, could rework the `needsStubs` to always create a stub the first time it encounters this branch type, and see what community thinks.
BTW, can't we trigger branch inversion by providing inverse FDATA even in compact mode (ie taken-path is hot)?
> I am observing the LongJmp pass being used even when we are in compact-code-model. Reading your comments makes me think it shouldn't be the case.
Yes, that's correct. I refer to 'compact-mode' as if it's a separate thing because in LongJmp we say: if [CompactMode is ON](https://github.com/llvm/llvm-project/blob/5587993548a6d764334c12b46616aa48606f2d6f/bolt/lib/Passes/LongJmp.cpp#L958), do this completely different thing and return.
That's because it's currently restricted to smaller binaries. Once the alternative path supports all cases, we may refactor into two separate passes, treating LongJmp as the legacy alternative.
https://github.com/llvm/llvm-project/pull/174972
More information about the llvm-commits
mailing list