[all-commits] [llvm/llvm-project] 6b82a0: [flang][cuda] Fix host loads from CUDA constant gl...

Zhen Wang via All-commits all-commits at lists.llvm.org
Fri Jun 12 16:09:15 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6b82a0485dbd6a6a5006329f2fa5f4e8bc977488
      https://github.com/llvm/llvm-project/commit/6b82a0485dbd6a6a5006329f2fa5f4e8bc977488
  Author: Zhen Wang <zhenw at nvidia.com>
  Date:   2026-06-12 (Fri, 12 Jun 2026)

  Changed paths:
    M flang/lib/Optimizer/Transforms/CUDA/CUFOpConversion.cpp
    M flang/test/Fir/CUDA/cuda-global-addr.mlir

  Log Message:
  -----------
  [flang][cuda] Fix host loads from CUDA constant globals (#203064)

This fixes CUDA Fortran lowering for scalar module variables with the
constant attribute that are read from host code, such as launch
configuration expressions or CUF kernel loop bounds.

Previously, host-side declarations for these globals could be rewritten
to device constant-memory addresses, causing host loads to dereference
the result of _FortranACUFGetDeviceAddress. The fix preserves host reads
from the host-visible global while still using the device address for
host-to-device assignment updates.

A FIR regression test covers host reads and assignment updates for
scalar CUDA constant globals.



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