Skip to content

Commit bc54528

Browse files
committed
[NFC][HIP] XFAIL amdgpu-builtin-in-lambda.hip (#32529)
Looks like it might be a bug in AMDGPU Sema. Due to: commit: [efa907e](https://github.com/intel-restricted/applications.compilers.llvm-project/commit//efa907e899339f1c2d9b885202ec23ed612300ed) for amdgpu-builtin-in-lambda.hip Author: Juan Manuel Martinez Caamaño [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
1 parent 0598c80 commit bc54528

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

clang/test/SemaHIP/amdgpu-builtin-in-lambda.hip

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// RUN: %clang_cc1 -std=c++20 -triple amdgcn -target-cpu gfx90a -fsyntax-only -fcuda-is-device -verify=gfx90a -o - %s
22
// RUN: %clang_cc1 -std=c++20 -triple amdgcn -target-cpu gfx950 -fsyntax-only -fcuda-is-device -o - %s
3+
// XFAIL: *
34

45
#define __device__ __attribute__((device))
56
#define __shared__ __attribute__((shared))

0 commit comments

Comments
 (0)