[all-commits] [llvm/llvm-project] e4d408: [OpenMP] Give the device shared memory allocations...
Abid Qadeer via All-commits
all-commits at lists.llvm.org
Thu Sep 10 04:49:34 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: e4d40831076278ffbfc7d883510d49db8fbfaa7c
https://github.com/llvm/llvm-project/commit/e4d40831076278ffbfc7d883510d49db8fbfaa7c
Author: Abid Qadeer <haqadeer at amd.com>
Date: 2026-09-10 (Thu, 10 Sep 2026)
Changed paths:
M llvm/include/llvm/Transforms/Utils/CodeExtractor.h
M llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
M llvm/lib/Transforms/Utils/CodeExtractor.cpp
A mlir/test/Target/LLVMIR/omptarget-debug-shared-alloc-loc.mlir
Log Message:
-----------
[OpenMP] Give the device shared memory allocations a debug location. (#221842)
Fixes https://github.com/llvm/llvm-project/issues/221831.
In generic mode on the device, the buffers that carry values into an
outlined region come from device shared memory rather than the stack, so
they are emitted as calls to `__kmpc_alloc_shared` and
`__kmpc_free_shared`. Those are definitions in the DeviceRTL, which
makes them inlinable calls, and the verifier requires an inlinable call
in a function with debug info to carry a !dbg location. None of these
calls had one, for two separate reasons.
1. `allocateVar()` and `deallocateVar()` took a bare insertion point, so
an override had no debug location to set on the runtime calls it emits
in place of the alloca the base class would have created. Fixed by
adding a `DebugLoc` parameter that carries one.
2. The `createOMPAllocShared `and `createOMPFreeShared` calls in
`createParallel` relied on the implicit conversion from an insertion
point to a `LocationDescription`, which selects the constructor that
leaves the debug location empty, and `updateToLocation` then installs
that empty location over whatever the builder had. Fixed by passing the
`Builder`, which carries the debug location along with the insertion
point. This is the same fix as #218961.
---------
Co-authored-by: Cursor <cursoragent at cursor.com>
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