<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/CodeGen/CFIFixup.cpp, branch main</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>[CodeGen] Remove unused includes (NFC) (#141320)</title>
<updated>2025-05-24T07:00:00+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-05-24T07:00:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3bc174ba772c551352004417c11c35503d6283ad'/>
<id>3bc174ba772c551352004417c11c35503d6283ad</id>
<content type='text'>
These are identified by misc-include-cleaner.  I've filtered out those
that break builds.  Also, I'm staying away from llvm-config.h,
config.h, and Compiler.h, which likely cause platform- or
compiler-specific build failures.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These are identified by misc-include-cleaner.  I've filtered out those
that break builds.  Also, I'm staying away from llvm-config.h,
config.h, and Compiler.h, which likely cause platform- or
compiler-specific build failures.</pre>
</div>
</content>
</entry>
<entry>
<title>[CFIFixup] Fixup CFI for split functions with synchronous uwtables (#125299)</title>
<updated>2025-02-11T23:25:08+00:00</updated>
<author>
<name>Daniel Hoekwater</name>
<email>hoekwater@google.com</email>
</author>
<published>2025-02-11T23:25:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3a22cf9bd85f77b5274304eda6f90d758f0a6664'/>
<id>3a22cf9bd85f77b5274304eda6f90d758f0a6664</id>
<content type='text'>
- **Precommit tests for synchronous uwtable CFI fixup**
- **[CFIFixup] Fixup CFI for split functions with synchronous uwtables**

Commit
https://github.com/llvm/llvm-project/commit/6e54fccede402c9ed0e8038aa258a99c5a2773e5
disables CFI fixup for
functions with synchronous tables, breaking CFI for split functions.
Instead, we can disable *block-level* CFI fixup for functions with
synchronous tables.

Unwind tables can be:
- N/A (not present)
- Asynchronous
- Synchronous

Functions without unwind tables don't need CFI fixup (since they don't
care about CFI).

Functions with asynchronous unwind tables must be accurate for each
basic block, so full CFI fixup is necessary.

Functions with synchronous unwind tables only need to be accurate for
each function (specifically, the portion of a function in a given
section). Disabling CFI fixup entirely for functions with synchronous
uwtables may break CFI for a function split between two sections. The
portion in the first section may have valid CFI, while the portion in
the second section is missing a call frame.

Ex:
```
(.text.hot)
Foo (BB1):
  &lt;Call frame information&gt;
  ...
BB2:
  ...

(.text.split)
BB3:
  ...
BB4:
  &lt;epilogue&gt;
```

Even if `Foo` has a synchronous unwind table, we still need to insert
call frame information into `BB3` so that unwinding the call stack from
`BB3` or `BB4` works properly.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- **Precommit tests for synchronous uwtable CFI fixup**
- **[CFIFixup] Fixup CFI for split functions with synchronous uwtables**

Commit
https://github.com/llvm/llvm-project/commit/6e54fccede402c9ed0e8038aa258a99c5a2773e5
disables CFI fixup for
functions with synchronous tables, breaking CFI for split functions.
Instead, we can disable *block-level* CFI fixup for functions with
synchronous tables.

Unwind tables can be:
- N/A (not present)
- Asynchronous
- Synchronous

Functions without unwind tables don't need CFI fixup (since they don't
care about CFI).

Functions with asynchronous unwind tables must be accurate for each
basic block, so full CFI fixup is necessary.

Functions with synchronous unwind tables only need to be accurate for
each function (specifically, the portion of a function in a given
section). Disabling CFI fixup entirely for functions with synchronous
uwtables may break CFI for a function split between two sections. The
portion in the first section may have valid CFI, while the portion in
the second section is missing a call frame.

Ex:
```
(.text.hot)
Foo (BB1):
  &lt;Call frame information&gt;
  ...
BB2:
  ...

(.text.split)
BB3:
  ...
BB4:
  &lt;epilogue&gt;
```

Even if `Foo` has a synchronous unwind table, we still need to insert
call frame information into `BB3` so that unwinding the call stack from
`BB3` or `BB4` works properly.</pre>
</div>
</content>
</entry>
<entry>
<title>[CFIFixup] Add a default constructor to BlockFlags (NFC) (#125296)</title>
<updated>2025-02-01T07:31:31+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-02-01T07:31:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=7271681286ec0eb8e1b0dc9982b3914701715d7f'/>
<id>7271681286ec0eb8e1b0dc9982b3914701715d7f</id>
<content type='text'>
This patch adds a default constructor to BlockFlags to initialize its
members to false, placing initializers close to the member
declarations.

Note that once C++20 is available in our codebase, we can replace
the explicit default constructor with:

  bool Reachable : 1 = true;
  :</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adds a default constructor to BlockFlags to initialize its
members to false, placing initializers close to the member
declarations.

Note that once C++20 is available in our codebase, we can replace
the explicit default constructor with:

  bool Reachable : 1 = true;
  :</pre>
</div>
</content>
</entry>
<entry>
<title>Reland "[CFIFixup] Factor logic into helpers and use range-based loops (NFC) #125137"</title>
<updated>2025-01-31T20:46:30+00:00</updated>
<author>
<name>Daniel Hoekwater</name>
<email>hoekwater@google.com</email>
</author>
<published>2025-01-31T20:43:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=82b923defe27cc46ecf3084f3a8f1c0d1c36199e'/>
<id>82b923defe27cc46ecf3084f3a8f1c0d1c36199e</id>
<content type='text'>
This patch was breaking tests due to inconsistent use of SmallVector.
After consolidating SmallVector usages, everything should work as
intended.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch was breaking tests due to inconsistent use of SmallVector.
After consolidating SmallVector usages, everything should work as
intended.
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[CFIFixup] Factor logic into helpers and use range-based loops (NFC) (#125137)"</title>
<updated>2025-01-31T20:22:00+00:00</updated>
<author>
<name>Daniel Hoekwater</name>
<email>hoekwater@google.com</email>
</author>
<published>2025-01-31T20:22:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9ff24f5114e5cd3f6f44d2269005e6b18e0906b3'/>
<id>9ff24f5114e5cd3f6f44d2269005e6b18e0906b3</id>
<content type='text'>
This reverts commit f14f19738916572322c310e84196134545c15c49, which
breaks a number of build bots:
- https://lab.llvm.org/buildbot/#/builders/163/builds/12726
- https://lab.llvm.org/buildbot/#/builders/144/builds/17106
- https://lab.llvm.org/buildbot/#/builders/123/builds/12855
- https://lab.llvm.org/buildbot/#/builders/133/builds/10660
- https://lab.llvm.org/buildbot/#/builders/88/builds/7482
- https://lab.llvm.org/buildbot/#/builders/180/builds/12313
- https://lab.llvm.org/buildbot/#/builders/160/builds/12316
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit f14f19738916572322c310e84196134545c15c49, which
breaks a number of build bots:
- https://lab.llvm.org/buildbot/#/builders/163/builds/12726
- https://lab.llvm.org/buildbot/#/builders/144/builds/17106
- https://lab.llvm.org/buildbot/#/builders/123/builds/12855
- https://lab.llvm.org/buildbot/#/builders/133/builds/10660
- https://lab.llvm.org/buildbot/#/builders/88/builds/7482
- https://lab.llvm.org/buildbot/#/builders/180/builds/12313
- https://lab.llvm.org/buildbot/#/builders/160/builds/12316
</pre>
</div>
</content>
</entry>
<entry>
<title>[CFIFixup] Factor logic into helpers and use range-based loops (NFC) (#125137)</title>
<updated>2025-01-31T19:44:53+00:00</updated>
<author>
<name>Daniel Hoekwater</name>
<email>hoekwater@google.com</email>
</author>
<published>2025-01-31T19:44:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f14f19738916572322c310e84196134545c15c49'/>
<id>f14f19738916572322c310e84196134545c15c49</id>
<content type='text'>
`runOnMachineFunction` is getting long (&gt;100 lines), and the logic
for computing block info and performing block fixup can be abstracted
away.

Reduce nesting in the main block fixup loop and name conditions to
reflect their purpose.

Replace manual usage of iterators with a range-based for loop.

Source:
-
https://llvm.org/docs/CodingStandards.html#use-early-exits-and-continue-to-simplify-code
-
https://llvm.org/docs/CodingStandards.html#use-range-based-for-loops-wherever-possible
-
https://llvm.org/docs/CodingStandards.html#don-t-evaluate-end-every-time-through-a-loop</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`runOnMachineFunction` is getting long (&gt;100 lines), and the logic
for computing block info and performing block fixup can be abstracted
away.

Reduce nesting in the main block fixup loop and name conditions to
reflect their purpose.

Replace manual usage of iterators with a range-based for loop.

Source:
-
https://llvm.org/docs/CodingStandards.html#use-early-exits-and-continue-to-simplify-code
-
https://llvm.org/docs/CodingStandards.html#use-range-based-for-loops-wherever-possible
-
https://llvm.org/docs/CodingStandards.html#don-t-evaluate-end-every-time-through-a-loop</pre>
</div>
</content>
</entry>
<entry>
<title>[CFIFixup] Add frame info to the first block of each section (#113626)</title>
<updated>2024-11-20T22:40:30+00:00</updated>
<author>
<name>Daniel Hoekwater</name>
<email>hoekwater@google.com</email>
</author>
<published>2024-11-20T22:40:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=07137ce3e1d7b9f18f579a9a2a4f47ec4270f156'/>
<id>07137ce3e1d7b9f18f579a9a2a4f47ec4270f156</id>
<content type='text'>
Now that `-fbasic-block-sections=list` is enabled for Arm, functions may
be split aross multiple sections, and CFI information must be handled
independently for each section.

On x86, this is handled in `llvm/lib/CodeGen/CFIInstrInserter.cpp`.
However, this pass does not run on Arm, so we must add logic for it
to `llvm/lib/CodeGen/CFIFixup.cpp`.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now that `-fbasic-block-sections=list` is enabled for Arm, functions may
be split aross multiple sections, and CFI information must be handled
independently for each section.

On x86, this is handled in `llvm/lib/CodeGen/CFIInstrInserter.cpp`.
However, this pass does not run on Arm, so we must add logic for it
to `llvm/lib/CodeGen/CFIFixup.cpp`.</pre>
</div>
</content>
</entry>
<entry>
<title>[CodeGen] Remove unused includes (NFC) (#115996)</title>
<updated>2024-11-13T07:15:06+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2024-11-13T07:15:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=735ab61ac828bd61398e6847d60e308fdf2b54ec'/>
<id>735ab61ac828bd61398e6847d60e308fdf2b54ec</id>
<content type='text'>
Identified with misc-include-cleaner.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Identified with misc-include-cleaner.</pre>
</div>
</content>
</entry>
<entry>
<title>Reland "CFIFixup] Factor CFI remember/restore insertion into a helper (NFC)" (#113387)</title>
<updated>2024-10-24T21:07:27+00:00</updated>
<author>
<name>Daniel Hoekwater</name>
<email>hoekwater@google.com</email>
</author>
<published>2024-10-24T21:07:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1b8cff9a52eab8718ba55996847ece0a96271bb7'/>
<id>1b8cff9a52eab8718ba55996847ece0a96271bb7</id>
<content type='text'>
The original patch (ac1a01f) dereferenced an end iterator, breaking some
tests (e.g. https://lab.llvm.org/buildbot/#/builders/17/builds/3116).
This updated patch only accesses the iterator when it's valid.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The original patch (ac1a01f) dereferenced an end iterator, breaking some
tests (e.g. https://lab.llvm.org/buildbot/#/builders/17/builds/3116).
This updated patch only accesses the iterator when it's valid.</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "Reland [CFIFixup] Factor CFI remember/restore insertion into a helper (NFC)" (#113340)</title>
<updated>2024-10-22T16:50:15+00:00</updated>
<author>
<name>Daniel Hoekwater</name>
<email>hoekwater@google.com</email>
</author>
<published>2024-10-22T16:50:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f66bc4d3f1ef5f4e16db0ac51a14f6941af90d0d'/>
<id>f66bc4d3f1ef5f4e16db0ac51a14f6941af90d0d</id>
<content type='text'>
Reverts llvm/llvm-project#113328

This change breaks a number of builds (e.g
https://lab.llvm.org/buildbot/#/builders/25/builds/3504), for some
reason. Reverting to do some troubleshooting.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reverts llvm/llvm-project#113328

This change breaks a number of builds (e.g
https://lab.llvm.org/buildbot/#/builders/25/builds/3504), for some
reason. Reverting to do some troubleshooting.</pre>
</div>
</content>
</entry>
</feed>
