[llvm] [BOLT] Don't remove nops in non-simple functions (PR #101964)
Vladislav Khmelevsky via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 8 07:27:46 PDT 2024
yota9 wrote:
@aaupov Could you please check that the regression is not caused by the tests (e.g. function size, instruction sequence & etc)?
Currently we have a problem that the nop could be removed before adrrelaxation pass in non-simple function. In order to address this we need to either change multiple passes order (so it should be function splitting -> adrrelaxation -> nop removal).
But the addrelaxation change [D143887](https://reviews.llvm.org/D143887) addresses the issue that at least on ARM we saw that offsets were not fixed by bolt. It was not me who find this problem, AFAIK the relocations might be in a form of symbol + offset - jump table address (PREL ones), so BOLT would only change symbol value of function and and jump table addresses properly, but offset would be constant in this case, so removing the NOP instruction offset would result in changing offset value and potential problems.
My suggestion here is that we should not change pass order, but preserve the logic from the patch above, so non-simple functions would preserve their nops. I don't think it's a big deal anyway, but if you insist I can set PreserveNops in BF inclusively for aarch64 targets somewhere in the code :)
https://github.com/llvm/llvm-project/pull/101964
More information about the llvm-commits
mailing list