<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/bolt/lib/Rewrite/LinuxKernelRewriter.cpp, branch users/meinersbur/flang_runtime_split-headers</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[BOLT] Detect Linux kernel version if the binary is a Linux kernel (#119088)</title>
<updated>2024-12-26T17:54:23+00:00</updated>
<author>
<name>Franklin</name>
<email>zhangfenglei@huawei.com</email>
</author>
<published>2024-12-26T17:54:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6e8a1a45a783c13e4cd19bfd20b7a56cab6f7d81'/>
<id>6e8a1a45a783c13e4cd19bfd20b7a56cab6f7d81</id>
<content type='text'>
This makes it easier to handle differences (e.g. of exception table
entry size) between versions of Linux kernel</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This makes it easier to handle differences (e.g. of exception table
entry size) between versions of Linux kernel</pre>
</div>
</content>
</entry>
<entry>
<title>[BOLT][Linux] Refactor reading of PC-relative addresses. NFCI (#120491)</title>
<updated>2024-12-19T18:40:25+00:00</updated>
<author>
<name>Maksim Panchenko</name>
<email>maks@fb.com</email>
</author>
<published>2024-12-19T18:40:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=21684e38ee65c89d1d0b399c938a83fba5e5c04e'/>
<id>21684e38ee65c89d1d0b399c938a83fba5e5c04e</id>
<content type='text'>
Fix evaluation order problem identified in
https://github.com/llvm/llvm-project/pull/119088.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix evaluation order problem identified in
https://github.com/llvm/llvm-project/pull/119088.</pre>
</div>
</content>
</entry>
<entry>
<title>[BOLT][Linux] Support ORC for alternative instructions (#96709)</title>
<updated>2024-06-28T02:26:11+00:00</updated>
<author>
<name>Maksim Panchenko</name>
<email>maks@fb.com</email>
</author>
<published>2024-06-28T02:26:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d16b21b17d13ecd88a068bb803df43e53d3b04ba'/>
<id>d16b21b17d13ecd88a068bb803df43e53d3b04ba</id>
<content type='text'>
Alternative instruction sequences in the Linux kernel can modify the
stack and thus they need their own ORC unwind entries. Since there's
only one ORC table, it has to be "shared" among multiple instruction
sequences. The kernel achieves this by putting a restriction on
instruction boundaries. If ORC state changes at a given IP, only one of
the alternative sequences can have an instruction starting/ending at
this IP. Then, developers can insert NOPs to guarantee the above
requirement is met.

The most common use of ORC with alternatives is "pushf; pop %rax"
sequence used for paravirtualization. Note that newer kernel versions
no longer use .parainstructions; instead, they utilize alternatives for
the same purpose.

Before we implement a better support for alternatives, we can safely
skip ORC entries associated with them.

Fixes #87052.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Alternative instruction sequences in the Linux kernel can modify the
stack and thus they need their own ORC unwind entries. Since there's
only one ORC table, it has to be "shared" among multiple instruction
sequences. The kernel achieves this by putting a restriction on
instruction boundaries. If ORC state changes at a given IP, only one of
the alternative sequences can have an instruction starting/ending at
this IP. Then, developers can insert NOPs to guarantee the above
requirement is met.

The most common use of ORC with alternatives is "pushf; pop %rax"
sequence used for paravirtualization. Note that newer kernel versions
no longer use .parainstructions; instead, they utilize alternatives for
the same purpose.

Before we implement a better support for alternatives, we can safely
skip ORC entries associated with them.

Fixes #87052.</pre>
</div>
</content>
</entry>
<entry>
<title>[BOLT] Skip optimization of functions with alt instructions (#95172)</title>
<updated>2024-06-18T19:33:37+00:00</updated>
<author>
<name>Maksim Panchenko</name>
<email>maks@fb.com</email>
</author>
<published>2024-06-18T19:33:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ad2905e52c2016a7de02ace59e33c3ca6ab53cd9'/>
<id>ad2905e52c2016a7de02ace59e33c3ca6ab53cd9</id>
<content type='text'>
Alternative instructions in the Linux kernel may modify control flow in
a function. As such, it is unsafe to optimize functions with alternative
instructions until we properly support CFG alternatives.

Previously, we marked functions with alt instructions before the
emission, but that could be too late if we remove or replace
instructions with alternatives. We could have marked functions as
non-simple immediately after reading .altinstructions, but it's nice to
be able to view functions after CFG is built. Thus assign the non-simple
status after building CFG.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Alternative instructions in the Linux kernel may modify control flow in
a function. As such, it is unsafe to optimize functions with alternative
instructions until we properly support CFG alternatives.

Previously, we marked functions with alt instructions before the
emission, but that could be too late if we remove or replace
instructions with alternatives. We could have marked functions as
non-simple immediately after reading .altinstructions, but it's nice to
be able to view functions after CFG is built. Thus assign the non-simple
status after building CFG.</pre>
</div>
</content>
</entry>
<entry>
<title>[BOLT] Fix duplicate diagnostic message (#95167)</title>
<updated>2024-06-13T21:56:01+00:00</updated>
<author>
<name>Maksim Panchenko</name>
<email>maks@fb.com</email>
</author>
<published>2024-06-13T21:56:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1ebda1173186c4c0ab776d1f140f903a49ace2a3'/>
<id>1ebda1173186c4c0ab776d1f140f903a49ace2a3</id>
<content type='text'>
Print .altinstructions parsing stats only once.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Print .altinstructions parsing stats only once.</pre>
</div>
</content>
</entry>
<entry>
<title>[BOLT] Add auto parsing for Linux kernel .altinstructions (#95068)</title>
<updated>2024-06-11T17:52:51+00:00</updated>
<author>
<name>Maksim Panchenko</name>
<email>maks@fb.com</email>
</author>
<published>2024-06-11T17:52:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=540893e43fb7a5e08deec0d951fd3c1d957f8f89'/>
<id>540893e43fb7a5e08deec0d951fd3c1d957f8f89</id>
<content type='text'>
.altinstructions section contains a list of structures where fields can
have different sizes while other fields could be present or not
depending on the kernel version. Add automatic detection of such
variations and use it by default. The user can still overwrite the
automatic detection with `--alt-inst-has-padlen` and
`--alt-inst-feature-size` options.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
.altinstructions section contains a list of structures where fields can
have different sizes while other fields could be present or not
depending on the kernel version. Add automatic detection of such
variations and use it by default. The user can still overwrite the
automatic detection with `--alt-inst-has-padlen` and
`--alt-inst-feature-size` options.</pre>
</div>
</content>
</entry>
<entry>
<title>[BOLT][NFCI] Fix return type of BC::getSignedValueAtAddress (#91664)</title>
<updated>2024-05-24T23:04:06+00:00</updated>
<author>
<name>Amir Ayupov</name>
<email>aaupov@fb.com</email>
</author>
<published>2024-05-24T23:04:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c460e454d16fe48e0b9bda5b34729f7e3ed4e2c0'/>
<id>c460e454d16fe48e0b9bda5b34729f7e3ed4e2c0</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[BOLT] Add support for Linux kernel .smp_locks section (#90798)</title>
<updated>2024-05-02T20:08:37+00:00</updated>
<author>
<name>Maksim Panchenko</name>
<email>maks@fb.com</email>
</author>
<published>2024-05-02T20:08:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=99b4532b8b724db5fcbb80b86053a4c7371f2c1e'/>
<id>99b4532b8b724db5fcbb80b86053a4c7371f2c1e</id>
<content type='text'>
Parse .smp_locks section entries and create fixups that are going to be
used to update the section before the binary emission.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Parse .smp_locks section entries and create fixups that are going to be
used to update the section before the binary emission.</pre>
</div>
</content>
</entry>
<entry>
<title>[BOLT] Register Linux kernel dynamic branch offsets (#90677)</title>
<updated>2024-05-02T04:56:55+00:00</updated>
<author>
<name>Maksim Panchenko</name>
<email>maks@fb.com</email>
</author>
<published>2024-05-02T04:56:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=59ab29213deffb8a18a18d2077ed268f5254b7f2'/>
<id>59ab29213deffb8a18a18d2077ed268f5254b7f2</id>
<content type='text'>
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.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.</pre>
</div>
</content>
</entry>
<entry>
<title>[BOLT] Add split function support for the Linux kernel (#90541)</title>
<updated>2024-05-02T04:45:44+00:00</updated>
<author>
<name>Maksim Panchenko</name>
<email>maks@fb.com</email>
</author>
<published>2024-05-02T04:45:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=dd09a7db03f8ebaeb3f49203bb53ac730666c1b4'/>
<id>dd09a7db03f8ebaeb3f49203bb53ac730666c1b4</id>
<content type='text'>
While rewriting the Linux kernel, we try to fit optimized functions into
their original boundaries. When a function becomes larger, we skip it
during the rewrite and end up with less than optimal code layout. To
overcome that issue, add support for --split-function option so that hot
part of the function could be fit into the original space. The cold part
should go to reserved space in the binary.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While rewriting the Linux kernel, we try to fit optimized functions into
their original boundaries. When a function becomes larger, we skip it
during the rewrite and end up with less than optimal code layout. To
overcome that issue, add support for --split-function option so that hot
part of the function could be fit into the original space. The cold part
should go to reserved space in the binary.</pre>
</div>
</content>
</entry>
</feed>
