-
Notifications
You must be signed in to change notification settings - Fork 10.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BOLT][AArch64] Fixes assertion errors occurred when perf2bolt was executed #83394
base: main
Are you sure you want to change the base?
Conversation
✅ With the latest revision this PR passed the C/C++ code formatter. |
…ecuted BOLT only checks for the most common indirect branch pattern during the branch analyzation. Extended the logic with two other indirect pattern which slightly differs from the expected one. Since these patterns are not related to JT, mark them as UNKNOWN branch. Fixes: llvm#83114
dba9931
to
ce4491e
Compare
Hello, thank you for a change. |
Hi @yota9, Sorry for the delayed response. Considering this pattern, this adr instruction its address could be PCRelbase, as I tried to follow the original logic maybe it could be "JT" as well. But we only have the address of the entry in sigall_set "section", should we know about the label address of the sigall_set?
a snippet of the print-cfg:
Binary attached: |
Hi @kaadam ! The signal_set is just closest (from above) symbol in the binary, probably it has nothing to do with JT. Consider 0x219fb0 as a base address. |
Two cases are identified in this patch, and TMU the first of which ( 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. test.c: int main() { return 1; } in lit test: 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. |
BOLT only checks for the most common indirect branch pattern during the branch analyzation. Extended the logic with two other indirect patterns which slightly differ from the expected one.
Since these patterns are not related to JT, mark them as UNKNOWN branch.
Fixes: #83114