[llvm] [BOLT][AArch64] Fixes assertion errors occurred when perf2bolt was executed (PR #83394)
Paschalis Mpeis via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 6 09:54:15 PDT 2024
paschalis-mpeis wrote:
Two cases are identified in this patch, and TMU the first of which (`(ShiftVal != 2)`) is hit by users more often. Virtually any stage-0 binary that is statically linked should hit this.
With the patch as is (ie returning 'false'), BOLT won't be able to build the CFG for such functions, meaning less optimizations but a stable binary regardless.
@kaadam has made some good progress locally, to properly parse these patterns, but it's still incomplete.
So I would suggest that we do this on 2 steps:
#### 1) have a quick workaround in place:
Merge for now something like the latest commit, plus some **added test**:
Any .c file, statically linked with libc triggers the first error.
Maybe we can emit some additional warning before returning false, or use `--print-cfg` or `-v=1` and FileCheck that.
test.c:
```c
int main() { return 1; }
```
in lit test:
```bash
clang -O0 test.c -static -o out
llvm-bolt out -o out.bolt
```
#### 2) use follow-up patches for a proper solution:
Parse the 2 patterns, extract any relevant info (JumpTable/Offset/Scale/Base), and adjust tests as needed.
The `DefJTBaseAdd` being an `ADR` would need an extra test. There's already good local progress on this direction..
https://github.com/llvm/llvm-project/pull/83394
More information about the llvm-commits
mailing list