[all-commits] [llvm/llvm-project] 4005ed: [CIR] Add ComputeVolatileBitfields Implementation ...

Andres-Salamanca via All-commits all-commits at lists.llvm.org
Thu Jul 31 08:13:19 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4005edd5c446f04a37856d69b47f1693364c12f0
      https://github.com/llvm/llvm-project/commit/4005edd5c446f04a37856d69b47f1693364c12f0
  Author: Andres-Salamanca <andrealebarbaritos at gmail.com>
  Date:   2025-07-31 (Thu, 31 Jul 2025)

  Changed paths:
    M clang/lib/CIR/CodeGen/CIRGenRecordLayoutBuilder.cpp
    A clang/test/CIR/CodeGen/aapcs-volatile-bitfields.c

  Log Message:
  -----------
  [CIR] Add ComputeVolatileBitfields Implementation (#151252)

This PR adds the implementation of the `ComputeVolatileBitfields`
function for the AAPCS ABI, following the rules described in [AAPCS64
ยง8.1.8.5 Volatile
Bit-fields](https://github.com/ARM-software/abi-aa/blob/f52e1ad3f81254497a83578dc102f6aac89e52d0/aapcs64/aapcs64.rst#8185volatile-bit-fields----preserving-number-and-width-of-container-accesses).
When accessing a volatile bit-field either reading or writing the
compiler must perform a load or store using the access size that matches
the width of the declared type (i.e., the type of the container), rather
than the packed bit-field size.
For example, if a field is declared as `int`, it must read or write 32
bits, even if the bit-field is only 3 bits wide.
The `ComputeVolatileBitfields` function calculates the correct values
and offsets necessary for proper lowering of volatile bitfields.
Support for emitting calls to `get_bitfield` and `set_bitfield` with the
correct access size for volatile bitfields will be implemented in a
future PR.



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