[PATCH] D127220: [BOLT][AArch64] Preserve in text object alignment

Rafael Auler via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 10 15:53:26 PDT 2022


rafauler added a comment.

TBH it's not like code that makes weird layout assumptions is really important/buying us much performance anyway... so we might just replace it if we can., at the source, or just skip it / preserve it untouched in the original section.

Another example comes from x86 library that puts data in code, for example. It will break BOLT for x86, it is not buying any performance, likely hurting performance by polluting icache. So why even bother writing it in assembly language. The worst part is that assembly-language writers are rarely aware of how to properly encode all the necessary metadata to comply with the ABI (e.g. CFI data completely wrong), so they will often just break it, put wrong symbol sizes in the symbol table, etc.

Once I found code that did a call to a function, but the callee was physically put right after the CALL, in a form of "inlining" but not really removing the CALL instruction. Then I had to write a pass to detect "internal calls" just because of that. That's why it is often easier to just -skip-funcs our way out of clowntown code because I'm afraid there are no limits to assembly-language writer's creativity.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127220/new/

https://reviews.llvm.org/D127220



More information about the llvm-commits mailing list