[all-commits] [llvm/llvm-project] f09850: [flang][CodeGen] Fix address space mismatch for CU...

khaki3 via All-commits all-commits at lists.llvm.org
Tue Apr 14 16:20:34 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f09850a332cd161bca0a1218e4f66869bc8b1a28
      https://github.com/llvm/llvm-project/commit/f09850a332cd161bca0a1218e4f66869bc8b1a28
  Author: khaki3 <47756807+khaki3 at users.noreply.github.com>
  Date:   2026-04-14 (Tue, 14 Apr 2026)

  Changed paths:
    M flang/lib/Optimizer/CodeGen/CodeGen.cpp
    M flang/test/Fir/CUDA/cuda-code-gen.mlir

  Log Message:
  -----------
  [flang][CodeGen] Fix address space mismatch for CUF globals in AddrOfOpConversion (#190408)

AddrOfOpConversion in CodeGen.cpp only handled `LLVM::GlobalOp` when
determining the address space for `llvm.mlir.addressof`. When the global
was still a `fir::GlobalOp` (not yet converted), it fell back to address
space 0, breaking CUF constant globals (addr_space 4) and AMDGPU targets
(global addr_space 1).

This extends the upstream fix (#192111, which only covered Constant) to
also handle Shared and Managed CUF data attributes, and returns
`std::nullopt` instead of 0 for non-CUF globals so the target's default
address space is preserved.



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