<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp, branch users/nico/python-2</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>[mc] Add CFI directive to emit val_offset() rules (#113971)</title>
<updated>2024-11-11T19:38:36+00:00</updated>
<author>
<name>Daniel Sanders</name>
<email>daniel_l_sanders@apple.com</email>
</author>
<published>2024-11-11T19:38:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=74003f11b3e4dd90665f8f8d911f40a22dd940d4'/>
<id>74003f11b3e4dd90665f8f8d911f40a22dd940d4</id>
<content type='text'>
These specify that the value of the given register in the previous frame
is the CFA plus some offset. This isn't very common but can be necessary
if the original value is normally reconstructed from the stack/frame
pointer instead of being saved on the stack and reloaded from there.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These specify that the value of the given register in the previous frame
is the CFA plus some offset. This isn't very common but can be necessary
if the original value is normally reconstructed from the stack/frame
pointer instead of being saved on the stack and reloaded from there.</pre>
</div>
</content>
</entry>
<entry>
<title>[AsmPrinter] Remove unused includes (NFC) (#114698)</title>
<updated>2024-11-03T15:03:02+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2024-11-03T15:03:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2fccd5c576f2e056954996c3071163fc5c1eb4d4'/>
<id>2fccd5c576f2e056954996c3071163fc5c1eb4d4</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>[AArch64][Libunwind] Add Support for FEAT_PAuthLR DWARF Instruction (#112171)</title>
<updated>2024-10-28T08:22:38+00:00</updated>
<author>
<name>Jack Styles</name>
<email>jack.styles@arm.com</email>
</author>
<published>2024-10-28T08:22:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=86f76c3b171f95fd0560339f2ad0f4449277cf8d'/>
<id>86f76c3b171f95fd0560339f2ad0f4449277cf8d</id>
<content type='text'>
As part of FEAT_PAuthLR, a new DWARF Frame Instruction was introduced,
`DW_CFA_AARCH64_negate_ra_state_with_pc`. This instructs Libunwind that
the PC has been used with the signing instruction. This change includes
three commits
- Libunwind support for the newly introduced DWARF Instruction
- CodeGen Support for the DWARF Instructions
- Reversing the changes made in #96377. Due to
`DW_CFA_AARCH64_negate_ra_state_with_pc`'s requirements to be placed
immediately after the signing instruction, this would mean the CFI
Instruction location was not consistent with the generated location when
not using FEAT_PAuthLR. The commit reverses the changes and makes the
location consistent across the different branch protection options.
While this does have a code size effect, this is a negligible one.

For the ABI information, see here:
https://github.com/ARM-software/abi-aa/blob/853286c7ab66048e4b819682ce17f567b77a0291/aadwarf64/aadwarf64.rst#id23</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As part of FEAT_PAuthLR, a new DWARF Frame Instruction was introduced,
`DW_CFA_AARCH64_negate_ra_state_with_pc`. This instructs Libunwind that
the PC has been used with the signing instruction. This change includes
three commits
- Libunwind support for the newly introduced DWARF Instruction
- CodeGen Support for the DWARF Instructions
- Reversing the changes made in #96377. Due to
`DW_CFA_AARCH64_negate_ra_state_with_pc`'s requirements to be placed
immediately after the signing instruction, this would mean the CFI
Instruction location was not consistent with the generated location when
not using FEAT_PAuthLR. The commit reverses the changes and makes the
location consistent across the different branch protection options.
While this does have a code size effect, this is a negligible one.

For the ABI information, see here:
https://github.com/ARM-software/abi-aa/blob/853286c7ab66048e4b819682ce17f567b77a0291/aadwarf64/aadwarf64.rst#id23</pre>
</div>
</content>
</entry>
<entry>
<title>[MC] Add SMLoc to MCCFIInstruction</title>
<updated>2023-06-27T00:58:29+00:00</updated>
<author>
<name>Fangrui Song</name>
<email>i@maskray.me</email>
</author>
<published>2023-06-27T00:58:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=665ccc19d38ccee9bba869ec9706610cefb10b0c'/>
<id>665ccc19d38ccee9bba869ec9706610cefb10b0c</id>
<content type='text'>
to help debug and report better diagnostics for functions like
relaxDwarfCallFrameFragment (D153167).

In MCStreamer, some emitCFI* functions already take a SMLoc argument. Add a
SMLoc argument to the remaining functions that generate a MCCFIInstruction.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
to help debug and report better diagnostics for functions like
relaxDwarfCallFrameFragment (D153167).

In MCStreamer, some emitCFI* functions already take a SMLoc argument. Add a
SMLoc argument to the remaining functions that generate a MCCFIInstruction.
</pre>
</div>
</content>
</entry>
<entry>
<title>[MSP430] Get the DWARF pointer size from MCAsmInfo instead of DataLayout.</title>
<updated>2023-05-04T19:37:30+00:00</updated>
<author>
<name>Ilya Kuklin</name>
<email>ikuklin@accesssoftek.com</email>
</author>
<published>2023-05-04T19:36:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c395a846001aa953e54916c6f88da22173efb25e'/>
<id>c395a846001aa953e54916c6f88da22173efb25e</id>
<content type='text'>
This change will allow to put code pointers in DWARF info fields that are larger than actual pointer size, e.g. 16-bit pointers into 32-bit fields.

The need for this came up while creating support for MSP430 in LLDB. MSP430-GCC already generates DWARF info with 32-bit fields, so this change is necessary for LLDB to maintain compatibility with both GCC and LLVM binaries. Moreover, right now in LLDB there is no support for having DWARF pointer size different from ELF header type, e.g. 16-bit DWARF info within ELF32, and it seems there is no such thing as ELF16.

Since other mainline targets are made to have the same pointer size in both MCAsmInfo and DataLayout, there is no need to change anything there.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D148042
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This change will allow to put code pointers in DWARF info fields that are larger than actual pointer size, e.g. 16-bit pointers into 32-bit fields.

The need for this came up while creating support for MSP430 in LLDB. MSP430-GCC already generates DWARF info with 32-bit fields, so this change is necessary for LLDB to maintain compatibility with both GCC and LLVM binaries. Moreover, right now in LLDB there is no support for having DWARF pointer size different from ELF header type, e.g. 16-bit DWARF info within ELF32, and it seems there is no such thing as ELF16.

Since other mainline targets are made to have the same pointer size in both MCAsmInfo and DataLayout, there is no need to change anything there.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D148042
</pre>
</div>
</content>
</entry>
<entry>
<title>[SanitizerBinaryMetadata] Emit constants as ULEB128</title>
<updated>2023-02-08T12:12:34+00:00</updated>
<author>
<name>Marco Elver</name>
<email>elver@google.com</email>
</author>
<published>2023-02-08T11:25:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=bf9814b70560637e322056135fb9a8e3c650e828'/>
<id>bf9814b70560637e322056135fb9a8e3c650e828</id>
<content type='text'>
Emit all constant integers produced by SanitizerBinaryMetadata as
ULEB128 to further reduce binary space used. Increasing the version is
not necessary given this change depends on (and will land) along with
the bump to v2.

To support this, the !pcsections metadata format is extended to allow
for per-section options, encoded in the first MD operator which must
always be a string and contain the section: "&lt;section&gt;!&lt;options&gt;".

Reviewed By: dvyukov

Differential Revision: https://reviews.llvm.org/D143484
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Emit all constant integers produced by SanitizerBinaryMetadata as
ULEB128 to further reduce binary space used. Increasing the version is
not necessary given this change depends on (and will land) along with
the bump to v2.

To support this, the !pcsections metadata format is extended to allow
for per-section options, encoded in the first MD operator which must
always be a string and contain the section: "&lt;section&gt;!&lt;options&gt;".

Reviewed By: dvyukov

Differential Revision: https://reviews.llvm.org/D143484
</pre>
</div>
</content>
</entry>
<entry>
<title>This patch allows llvm-dwarfutil to utilize accelerator tables</title>
<updated>2023-01-16T13:42:30+00:00</updated>
<author>
<name>Alexey Lapshin</name>
<email>a.v.lapshin@mail.ru</email>
</author>
<published>2023-01-15T21:31:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2216ee4909f01d6547fd3bda978c00b2c587ff2f'/>
<id>2216ee4909f01d6547fd3bda978c00b2c587ff2f</id>
<content type='text'>
generation code from DWARFLinker. It adds command line option:

--build-accelerator [none,DWARF]
                        Build accelerator tables(default: none)
  =none - Do not build accelerators
  =DWARF - Build accelerator tables according to the resulting DWARF version
       DWARFv4: .debug_pubnames and .debug_pubtypes
       DWARFv5: .debug_names

Differential Revision: https://reviews.llvm.org/D139638
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
generation code from DWARFLinker. It adds command line option:

--build-accelerator [none,DWARF]
                        Build accelerator tables(default: none)
  =none - Do not build accelerators
  =DWARF - Build accelerator tables according to the resulting DWARF version
       DWARFv4: .debug_pubnames and .debug_pubtypes
       DWARFv5: .debug_names

Differential Revision: https://reviews.llvm.org/D139638
</pre>
</div>
</content>
</entry>
<entry>
<title>[CodeGen] Qualify auto variables in for loops (NFC)</title>
<updated>2022-07-17T08:33:28+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2022-07-17T08:33:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9e6d1f4b5d393b8d74640c72b94ccc23ed4ee885'/>
<id>9e6d1f4b5d393b8d74640c72b94ccc23ed4ee885</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[MC] Lower case the first letter of EmitCOFF* EmitWin* EmitCV*. NFC</title>
<updated>2022-05-26T07:14:08+00:00</updated>
<author>
<name>Fangrui Song</name>
<email>i@maskray.me</email>
</author>
<published>2022-05-26T07:14:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9ee15bba4744fb3b671428eec3cbec6a424dde07'/>
<id>9ee15bba4744fb3b671428eec3cbec6a424dde07</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[CodeGen] Async unwind - add a pass to fix CFI information</title>
<updated>2022-04-11T12:27:26+00:00</updated>
<author>
<name>Momchil Velikov</name>
<email>momchil.velikov@arm.com</email>
</author>
<published>2022-04-11T11:08:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b4ad28da196d3c2b1bc064b4dc46c3e00e93438f'/>
<id>b4ad28da196d3c2b1bc064b4dc46c3e00e93438f</id>
<content type='text'>
This pass inserts the necessary CFI instructions to compensate for the
inconsistency of the call-frame information caused by linear (non-CGA
aware) nature of the unwind tables.

Unlike the `CFIInstrInserer` pass, this one almost always emits only
`.cfi_remember_state`/`.cfi_restore_state`, which results in smaller
unwind tables and also transparently handles custom unwind info
extensions like CFA offset adjustement and save locations of SVE
registers.

This pass takes advantage of the constraints taht LLVM imposes on the
placement of save/restore points (cf. `ShrinkWrap.cpp`):

  * there is a single basic block, containing the function prologue

  * possibly multiple epilogue blocks, where each epilogue block is
    complete and self-contained, i.e. CSR restore instructions (and the
    corresponding CFI instructions are not split across two or more
    blocks.

  * prologue and epilogue blocks are outside of any loops

Thus, during execution, at the beginning and at the end of each basic
block the function can be in one of two states:

  - "has a call frame", if the function has executed the prologue, or
     has not executed any epilogue

  - "does not have a call frame", if the function has not executed the
    prologue, or has executed an epilogue

These properties can be computed for each basic block by a single RPO
traversal.

From the point of view of the unwind tables, the "has/does not have
call frame" state at beginning of each block is determined by the
state at the end of the previous block, in layout order.

Where these states differ, we insert compensating CFI instructions,
which come in two flavours:

- CFI instructions, which reset the unwind table state to the
    initial one.  This is done by a target specific hook and is
    expected to be trivial to implement, for example it could be:
```
     .cfi_def_cfa &lt;sp&gt;, 0
     .cfi_same_value &lt;rN&gt;
     .cfi_same_value &lt;rN-1&gt;
     ...
```
where `&lt;rN&gt;` are the callee-saved registers.

- CFI instructions, which reset the unwind table state to the one
    created by the function prologue. These are the sequence:
```
       .cfi_restore_state
       .cfi_remember_state
```
In this case we also insert a `.cfi_remember_state` after the
last CFI instruction in the function prologue.

Reviewed By: MaskRay, danielkiss, chill

Differential Revision: https://reviews.llvm.org/D114545
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This pass inserts the necessary CFI instructions to compensate for the
inconsistency of the call-frame information caused by linear (non-CGA
aware) nature of the unwind tables.

Unlike the `CFIInstrInserer` pass, this one almost always emits only
`.cfi_remember_state`/`.cfi_restore_state`, which results in smaller
unwind tables and also transparently handles custom unwind info
extensions like CFA offset adjustement and save locations of SVE
registers.

This pass takes advantage of the constraints taht LLVM imposes on the
placement of save/restore points (cf. `ShrinkWrap.cpp`):

  * there is a single basic block, containing the function prologue

  * possibly multiple epilogue blocks, where each epilogue block is
    complete and self-contained, i.e. CSR restore instructions (and the
    corresponding CFI instructions are not split across two or more
    blocks.

  * prologue and epilogue blocks are outside of any loops

Thus, during execution, at the beginning and at the end of each basic
block the function can be in one of two states:

  - "has a call frame", if the function has executed the prologue, or
     has not executed any epilogue

  - "does not have a call frame", if the function has not executed the
    prologue, or has executed an epilogue

These properties can be computed for each basic block by a single RPO
traversal.

From the point of view of the unwind tables, the "has/does not have
call frame" state at beginning of each block is determined by the
state at the end of the previous block, in layout order.

Where these states differ, we insert compensating CFI instructions,
which come in two flavours:

- CFI instructions, which reset the unwind table state to the
    initial one.  This is done by a target specific hook and is
    expected to be trivial to implement, for example it could be:
```
     .cfi_def_cfa &lt;sp&gt;, 0
     .cfi_same_value &lt;rN&gt;
     .cfi_same_value &lt;rN-1&gt;
     ...
```
where `&lt;rN&gt;` are the callee-saved registers.

- CFI instructions, which reset the unwind table state to the one
    created by the function prologue. These are the sequence:
```
       .cfi_restore_state
       .cfi_remember_state
```
In this case we also insert a `.cfi_remember_state` after the
last CFI instruction in the function prologue.

Reviewed By: MaskRay, danielkiss, chill

Differential Revision: https://reviews.llvm.org/D114545
</pre>
</div>
</content>
</entry>
</feed>
