[all-commits] [llvm/llvm-project] 59ab29: [BOLT] Register Linux kernel dynamic branch offset...
Maksim Panchenko via All-commits
all-commits at lists.llvm.org
Wed May 1 21:57:18 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 59ab29213deffb8a18a18d2077ed268f5254b7f2
https://github.com/llvm/llvm-project/commit/59ab29213deffb8a18a18d2077ed268f5254b7f2
Author: Maksim Panchenko <maks at fb.com>
Date: 2024-05-01 (Wed, 01 May 2024)
Changed paths:
M bolt/lib/Rewrite/LinuxKernelRewriter.cpp
M bolt/test/X86/linux-static-keys.s
Log Message:
-----------
[BOLT] Register Linux kernel dynamic branch offsets (#90677)
To match profile data to code we need to know branch instruction offsets
within a function. For this reason, we mark branches with the "Offset"
annotation while disassembling the code. However, _dynamic_ branches in
the Linux kernel could be NOPs in disassembled code, and we ignore them
while adding annotations. We need to explicitly add the "Offset"
annotation while creating dynamic branches.
Note that without this change, `getInstructionAtOffset()` would still
return a branch instruction if the offset matched the last instruction
in a basic block (and the profile data was matched correctly). However,
the function failed for cases when the searched instruction was followed
by an unconditional jump. "Offset" annotation solves this case.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list