<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/bolt/lib/Rewrite/LinuxKernelRewriter.cpp, branch users/shawbyoung/spr/main.boltnfc-refactoring-callgraph</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] 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>
<entry>
<title>[BOLT] Fix a warning</title>
<updated>2024-04-30T22:16:01+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2024-04-30T22:16:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=805e08ef26a4dd4c3048a836a49219545a211686'/>
<id>805e08ef26a4dd4c3048a836a49219545a211686</id>
<content type='text'>
This patch fixes:

  bolt/lib/Rewrite/LinuxKernelRewriter.cpp:855:12: error: variable
  'PrevIP' set but not used [-Werror,-Wunused-but-set-variable]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch fixes:

  bolt/lib/Rewrite/LinuxKernelRewriter.cpp:855:12: error: variable
  'PrevIP' set but not used [-Werror,-Wunused-but-set-variable]
</pre>
</div>
</content>
</entry>
<entry>
<title>[BOLT] Add ORC validation for the Linux kernel (#90660)</title>
<updated>2024-04-30T21:17:33+00:00</updated>
<author>
<name>Maksim Panchenko</name>
<email>maks@fb.com</email>
</author>
<published>2024-04-30T21:17:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c665e49911a0f029564a816b71dce5bf1c81f3a9'/>
<id>c665e49911a0f029564a816b71dce5bf1c81f3a9</id>
<content type='text'>
The Linux kernel expects ORC tables to be sorted by IP address (for
binary search to work). Add a post-emit pass in LinuxKernelRewriter that
validates the written .orc_unwind_ip against that expectation.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The Linux kernel expects ORC tables to be sorted by IP address (for
binary search to work). Add a post-emit pass in LinuxKernelRewriter that
validates the written .orc_unwind_ip against that expectation.</pre>
</div>
</content>
</entry>
<entry>
<title>[BOLT] Add rewriting support for Linux kernel __bug_table (#86908)</title>
<updated>2024-03-28T17:30:27+00:00</updated>
<author>
<name>Maksim Panchenko</name>
<email>maks@fb.com</email>
</author>
<published>2024-03-28T17:30:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=35e7d458c9b452b5c09736ffc832aa31777cef21'/>
<id>35e7d458c9b452b5c09736ffc832aa31777cef21</id>
<content type='text'>
Update instruction locations in the __bug_table section after new code
is emitted. If an instruction with associated bug ID was deleted,
overwrite its location with zero.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Update instruction locations in the __bug_table section after new code
is emitted. If an instruction with associated bug ID was deleted,
overwrite its location with zero.</pre>
</div>
</content>
</entry>
</feed>
