[all-commits] [llvm/llvm-project] 22a10c: [OpenMP][Flang] Fix atomic operations on complex t...

Krish Gupta via All-commits all-commits at lists.llvm.org
Wed Oct 29 06:56:13 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 22a10c8c2141b1a2794f475272281b1ad64f56cb
      https://github.com/llvm/llvm-project/commit/22a10c8c2141b1a2794f475272281b1ad64f56cb
  Author: Krish Gupta <krishom70 at gmail.com>
  Date:   2025-10-29 (Wed, 29 Oct 2025)

  Changed paths:
    A flang/test/Lower/OpenMP/atomic-read-complex.f90
    A flang/test/Lower/OpenMP/atomic-write-complex.f90
    M llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
    M llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp

  Log Message:
  -----------
  [OpenMP][Flang] Fix atomic operations on complex types (#165366)

Fixes https://github.com/llvm/llvm-project/issues/165184

In OMPIRBuilder::createAtomicRead() and createAtomicWrite(), the size
parameter for __atomic_load/__atomic_store was incorrectly computed
from the pointer type instead of the pointee (element) type.

On 64-bit systems, this resulted in only 8 bytes being transferred
regardless of the actual struct size.

Changed both functions to use XElemTy (element type) instead of the
pointer type when computing LoadSize. This ensures the full struct
is transferred.



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