[llvm] [BOLT][AArch64] Support cdsplit for AArch64 (PR #121475)
Paschalis Mpeis via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 23 01:15:26 PST 2025
https://github.com/paschalis-mpeis commented:
Hey @liusy58,
Thanks for adding support for `cdsplit` to LongJmp. It looks like you have created local/global warm stub groups.
The assertion you [aim to eliminate](https://github.com/llvm/llvm-project/pull/121475/files#diff-89ce892ef20346fe79278dbafccad479feb00449e85d02772413a8386655f37eL675) in `isCold` is not AArch64-specific and LongJmp is not the only area affected. I believe it'll be hard to do all these changes in one go, which is why I think that more PRs will be probably needed. What Meta thinks here? (@ShatianWang, @maksfb)
For example using `-split-strategy=cdsplit --dump-dot-all` should crash regardless of architecture. On X86 one can indeed get a binary with hot/warm/cold sections, but I'm not sure to which extend this is due to luck. I would expect under some scenarios to hit this assertion with ICP, ShrinkWrapping, and TailDuplication, ..
Now on AArch64, the crash happens in most binaries of interest. That is because `LongJmp` always runs and when it adds some stubs the assertion is triggered. So we definitely want to support it.
#### Noting AArch64-specific behaviour with ASSERTIONS off:
If one uses llvm-bolt with ASSERTIONS Off, they will get a number of 'fixup' errors being out of range and ultimately LongJmp will stuck, probably in some sort of an infinite loop.
BTW those fixup errors happen when the AsmBackend cannot adjustFixupValue and they are not crashing bolt:
```
<unknown>:0: error: fixup value out of range
```
## Next steps on this PR?
We will need Meta opinion on this. Given we agree on multiple PRs, I made a suggestion below to keep the assertion but make it conditional. LongJmp can then come as a separate PR. More PRs will be needed for the other areas.
https://github.com/llvm/llvm-project/pull/121475
More information about the llvm-commits
mailing list