Commit 6b8d5d9
committed
[BOLT][Linux] Optionally only handle C functions
BOLT can not handle some functions defined in assembly code reliably, since
they may have extra semantics/enforcements BOLT can never know. For example,
irq_entries_start defined in arch/x86/include/asm/idtentry.h is actually an
“array” but BOLT views it as an ordinary function. If BOLT applies basic
block reordering, instrumentation, etc to it, run time errors would happen.
We could explicitly specify those functions to skip, but to find all of them
we usually need to test & debug many times. That is a lot of work and we may
still miss some.
In my own experience, when adapting BOLT for Linux to a new architecture or
Linux version, we may spend lots of time on fixing runtime errors related to
functions defined in assembly code.
Only handling C functions makes BOLT for Linux more reliable, and may save
lots of development efforts.
It can be used as follows:
* put "-mllvm -bolt-function-list-file=filename" in KCFLAGS when
buildling Linux
* specify "-funcs-file-no-regex=filename" when invoking llvm-bolt1 parent 01cc1d1 commit 6b8d5d9
1 file changed
+13
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
| |||
274 | 275 | | |
275 | 276 | | |
276 | 277 | | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
277 | 282 | | |
278 | 283 | | |
279 | 284 | | |
| |||
506 | 511 | | |
507 | 512 | | |
508 | 513 | | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
509 | 522 | | |
510 | 523 | | |
511 | 524 | | |
| |||
0 commit comments