[all-commits] [llvm/llvm-project] cd8c01: [OpenMP] Use ext linkage for kernels handles and g...

Johannes Doerfert via All-commits all-commits at lists.llvm.org
Mon Jun 1 15:29:01 PDT 2026


  Branch: refs/heads/users/jdoerfert/openmp_kernel_name
  Home:   https://github.com/llvm/llvm-project
  Commit: cd8c015b9a8c8b861e9749fed1daa9656fc73ae5
      https://github.com/llvm/llvm-project/commit/cd8c015b9a8c8b861e9749fed1daa9656fc73ae5
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2026-06-01 (Mon, 01 Jun 2026)

  Changed paths:
    M clang/test/OpenMP/amdgcn_weak_alias.c
    M clang/test/OpenMP/declare_target_codegen.cpp
    M clang/test/OpenMP/target_codegen.cpp
    M clang/test/OpenMP/target_depend_codegen.cpp
    M clang/test/OpenMP/target_indirect_codegen.cpp
    M clang/test/OpenMP/target_parallel_depend_codegen.cpp
    M clang/test/OpenMP/target_parallel_for_depend_codegen.cpp
    M clang/test/OpenMP/target_parallel_for_simd_depend_codegen.cpp
    M clang/test/OpenMP/target_simd_codegen.cpp
    M clang/test/OpenMP/target_simd_depend_codegen.cpp
    M clang/test/OpenMP/target_teams_depend_codegen.cpp
    M clang/test/OpenMP/target_teams_distribute_depend_codegen.cpp
    M clang/test/OpenMP/target_teams_distribute_parallel_for_depend_codegen.cpp
    M clang/test/OpenMP/target_teams_distribute_parallel_for_simd_depend_codegen.cpp
    M clang/test/OpenMP/target_teams_distribute_simd_depend_codegen.cpp
    M llvm/include/llvm/Frontend/Offloading/Utility.h
    M llvm/lib/Frontend/Offloading/Utility.cpp
    M llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
    M mlir/test/Target/LLVMIR/omptarget-declare-target-llvm-host.mlir
    M mlir/test/Target/LLVMIR/omptarget-declare-target-to-host.mlir

  Log Message:
  -----------
  [OpenMP] Use ext linkage for kernels handles and globals handles keep linkage

Host handles are now emmitted with external linkage to clash if two
kernels with the same name are registered. This could have happen right
now and silently corrupt the program, but it can happen more easily once
we allow users to name their kernels.

In the same patch we make global variable handles retain the linkage of
the global variable, forcing clashes for external ones and continue to
support weak use cases.


  Commit: 1d760d4a45ffd15e486a02a75176ddd4b41d5b73
      https://github.com/llvm/llvm-project/commit/1d760d4a45ffd15e486a02a75176ddd4b41d5b73
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2026-06-01 (Mon, 01 Jun 2026)

  Changed paths:
    M clang/include/clang/AST/OpenMPClause.h
    M clang/include/clang/AST/RecursiveASTVisitor.h
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/include/clang/Sema/SemaOpenMP.h
    M clang/lib/AST/OpenMPClause.cpp
    M clang/lib/AST/StmtProfile.cpp
    M clang/lib/CodeGen/CGOpenMPRuntime.cpp
    M clang/lib/Parse/ParseOpenMP.cpp
    M clang/lib/Sema/SemaOpenMP.cpp
    M clang/lib/Sema/TreeTransform.h
    M clang/lib/Serialization/ASTReader.cpp
    M clang/lib/Serialization/ASTWriter.cpp
    A clang/test/OpenMP/ompx_name_codegen.cpp
    A clang/test/OpenMP/ompx_name_messages_errors.cpp
    M clang/tools/libclang/CIndex.cpp
    M llvm/include/llvm/Frontend/OpenMP/OMP.td
    M llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
    M llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
    A offload/test/offloading/ompx_name.c
    A offload/test/offloading/ompx_name_duplicate_link.c

  Log Message:
  -----------
  [OpenMP] Introduce the ompx_name clause for kernel naming

This adds support for the ompx_name clause that allows users to specify
custom kernel names for OpenMP target offloading regions. The clause
accepts a string literal and overrides the default compiler-generated
kernel names.

Example usage:
  #pragma omp target ompx_name("my_kernel")
  { ... }

Kernel names need to be unique or they are diagnosed at compile or link
time as errors.

Co-Authored-By: Claude (claude-sonnet-4.5) <noreply at anthropic.com>


Compare: https://github.com/llvm/llvm-project/compare/4f152a59b504...1d760d4a45ff

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