[all-commits] [llvm/llvm-project] d5401c: [flang][cuda] Record implicit managed attribution ...

Kareem Ergawy via All-commits all-commits at lists.llvm.org
Mon Sep 21 03:41:06 PDT 2026


  Branch: refs/heads/users/ergawy/managed-implicit-modfile
  Home:   https://github.com/llvm/llvm-project
  Commit: d5401c5bfeae089647435bd08286a1a9d3d93903
      https://github.com/llvm/llvm-project/commit/d5401c5bfeae089647435bd08286a1a9d3d93903
  Author: ergawy <kareem.ergawy at gmail.com>
  Date:   2026-09-21 (Mon, 21 Sep 2026)

  Changed paths:
    M flang/include/flang/Parser/dump-parse-tree.h
    M flang/include/flang/Parser/parse-tree.h
    M flang/lib/Parser/Fortran-parsers.cpp
    M flang/lib/Parser/unparse.cpp
    M flang/lib/Semantics/mod-file.cpp
    M flang/lib/Semantics/resolve-names.cpp
    M flang/test/Parser/cuf-sanity-tree.CUF
    A flang/test/Semantics/CUDA/cuda-managed-implicit-modfile.cuf

  Log Message:
  -----------
  [flang][cuda] Record implicit managed attribution in module files

An attribute the compiler applied under -gpu=mem:managed is written into the
module file the same way a user-written one is, so a reader cannot tell them
apart. It then treats the attribute as a user requirement: allocating such a
component in a DEVICE object is rejected, and the memory space the user did
ask for on the object no longer wins.

Spell the distinction in the module file as MANAGED(IMPLICIT), modelled on
INTENT(IN): CUDA-data-attr gains an optional parenthesized qualifier, carried
by a new CUDADataAttrSpec parse-tree node in AttrSpec and ComponentAttrSpec.
ATTRIBUTES(...) keeps the bare attribute, so the qualifier cannot be written
there.

The attribute itself is still written out, so a component keeps the same
memory space no matter which options a consumer is compiled with.

Also stop an implicitly applied attribute from making a module a definer of
CUDA symbols. Without this, adding -gpu=mem:managed to a module's build
rejects its OpenACC-only consumers over an attribute the user never wrote.


  Commit: ec707f41332ce744d3f340c6012af3c674e4e990
      https://github.com/llvm/llvm-project/commit/ec707f41332ce744d3f340c6012af3c674e4e990
  Author: ergawy <kareem.ergawy at gmail.com>
  Date:   2026-09-21 (Mon, 21 Sep 2026)

  Changed paths:
    M flang/docs/ModFiles.md
    M flang/include/flang/Support/Fortran-features.h
    M flang/lib/Parser/Fortran-parsers.cpp
    M flang/lib/Semantics/mod-file.cpp
    M flang/lib/Support/Fortran-features.cpp
    M flang/test/Semantics/CUDA/cuda-managed-implicit-modfile.cuf

  Log Message:
  -----------
  [flang][cuda] Restrict the MANAGED(IMPLICIT) spelling to module files


Compare: https://github.com/llvm/llvm-project/compare/b9b829eebc25...ec707f41332c

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