[all-commits] [llvm/llvm-project] efa907: [Clang][AMDGPU] Defer amdgcn.*to_lds builtins size...

Juan Manuel Martinez Caamaño via All-commits all-commits at lists.llvm.org
Thu Sep 25 00:12:59 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: efa907e899339f1c2d9b885202ec23ed612300ed
      https://github.com/llvm/llvm-project/commit/efa907e899339f1c2d9b885202ec23ed612300ed
  Author: Juan Manuel Martinez Caamaño <jmartinezcaamao at gmail.com>
  Date:   2025-09-25 (Thu, 25 Sep 2025)

  Changed paths:
    M clang/lib/Sema/SemaAMDGPU.cpp
    M clang/test/SemaHIP/amdgpu-builtin-in-lambda.hip
    A clang/test/SemaHIP/amdgpu-gfx950-load-to-lds.hip

  Log Message:
  -----------
  [Clang][AMDGPU] Defer amdgcn.*to_lds builtins size diagnostics (#160140)

Before, the diagnostic was emitted immediately, as soon as the error was
detected. This is problematic during the host compilation, since
the compiler performs semantic analysis of `__device__` functions with
the host's
target attributes.

A solution for this is to use `SemaRef.targetDiag` to defer the
diagnostic. The diagnostic will then be printed only if the function is
emitted.

The test included in this patch highlights a second problem: we cannot
compile a file having a call to `__builtin_amdgcn_load_to_lds` on a
`__device__` function since we typecheck the signature.
The issue is that, `__shared__ void*` on X86 doesn't translate to
`addrspace(3) void*`, so the compilation fails.

Fixes: SWDEV-555501



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