[clang] [Clang][AMDGPU] Accept builtins in lambda declarations (PR #135027)

2025-04-11 Thread Juan Manuel Martinez Caamaño via cfe-commits
https://github.com/jmmartinez closed https://github.com/llvm/llvm-project/pull/135027 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AMDGPU] Accept builtins in lambda declarations (PR #135027)

2025-04-11 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm approved this pull request. https://github.com/llvm/llvm-project/pull/135027 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AMDGPU] Accept builtins in lambda declarations (PR #135027)

2025-04-11 Thread Juan Manuel Martinez Caamaño via cfe-commits
jmmartinez wrote: > IIRC there were bugs when you try to use lambda in conjunction with the > target attribute. Can you add a test where you try to use a builtin that > depends on a subtarget feature, in a function marked with the target > attribute (and not available in the main compile targe

[clang] [Clang][AMDGPU] Accept builtins in lambda declarations (PR #135027)

2025-04-11 Thread Juan Manuel Martinez Caamaño via cfe-commits
https://github.com/jmmartinez updated https://github.com/llvm/llvm-project/pull/135027 From a22e56d063e91df667d89ed5238bd886ce10bd0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Manuel=20Martinez=20Caama=C3=B1o?= Date: Wed, 9 Apr 2025 15:11:19 +0200 Subject: [PATCH] [Clang][AMDGPU] Accept bu

[clang] [Clang][AMDGPU] Accept builtins in lambda declarations (PR #135027)

2025-04-10 Thread Matt Arsenault via cfe-commits
Juan Manuel Martinez =?utf-8?q?Caamaño?= , Juan Manuel Martinez =?utf-8?q?Caamaño?= , Juan Manuel Martinez =?utf-8?q?Caamaño?= Message-ID: In-Reply-To: https://github.com/arsenm edited https://github.com/llvm/llvm-project/pull/135027 ___ cfe-commits

[clang] [Clang][AMDGPU] Accept builtins in lambda declarations (PR #135027)

2025-04-10 Thread Matt Arsenault via cfe-commits
Juan Manuel Martinez =?utf-8?q?Caamaño?= , Juan Manuel Martinez =?utf-8?q?Caamaño?= , Juan Manuel Martinez =?utf-8?q?Caamaño?= Message-ID: In-Reply-To: https://github.com/arsenm commented: IIRC there were bugs when you try to use lambda in conjunction with the target attribute. Can you add a

[clang] [Clang][AMDGPU] Accept builtins in lambda declarations (PR #135027)

2025-04-10 Thread Juan Manuel Martinez Caamaño via cfe-commits
https://github.com/jmmartinez updated https://github.com/llvm/llvm-project/pull/135027 From 4e5736d1b90ae477642ea03dcf39231f5f0a8e59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Manuel=20Martinez=20Caama=C3=B1o?= Date: Wed, 9 Apr 2025 15:11:19 +0200 Subject: [PATCH 1/4] [Clang][AMDGPU] Accep

[clang] [Clang][AMDGPU] Accept builtins in lambda declarations (PR #135027)

2025-04-09 Thread Juan Manuel Martinez Caamaño via cfe-commits
@@ -0,0 +1,24 @@ +// REQUIRES: amdgpu-registered-target +// RUN: %clang_cc1 -std=c++20 -triple amdgcn -target-cpu tahiti -fsyntax-only -fcuda-is-device -verify=expected -o - %s +// RUN: %clang_cc1 -std=c++20 -triple amdgcn -target-cpu gfx950 -fsyntax-only -fcuda-is-device -o - %

[clang] [Clang][AMDGPU] Accept builtins in lambda declarations (PR #135027)

2025-04-09 Thread Matt Arsenault via cfe-commits
@@ -0,0 +1,24 @@ +// REQUIRES: amdgpu-registered-target arsenm wrote: -emit-llvm should work fine, real codegen will obviously fail https://github.com/llvm/llvm-project/pull/135027 ___ cfe-commits mailing list cfe-com

[clang] [Clang][AMDGPU] Accept builtins in lambda declarations (PR #135027)

2025-04-09 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: LGTM. Pls address other comments https://github.com/llvm/llvm-project/pull/135027 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AMDGPU] Accept builtins in lambda declarations (PR #135027)

2025-04-09 Thread Artem Belevich via cfe-commits
@@ -0,0 +1,24 @@ +// REQUIRES: amdgpu-registered-target Artem-B wrote: I've just checked using experimental target `csky-unknown-elf ` that's not enabled by default, and clang indeed errors out if we attempt to generate code, but works OK with `-fsyntax-only`.

[clang] [Clang][AMDGPU] Accept builtins in lambda declarations (PR #135027)

2025-04-09 Thread Shilei Tian via cfe-commits
@@ -27,7 +27,7 @@ bool SemaAMDGPU::CheckAMDGCNBuiltinFunctionCall(unsigned BuiltinID, // position of memory order and scope arguments in the builtin unsigned OrderIndex, ScopeIndex; - const auto *FD = SemaRef.getCurFunctionDecl(); + const auto *FD = SemaRef.getCurFuncti

[clang] [Clang][AMDGPU] Accept builtins in lambda declarations (PR #135027)

2025-04-09 Thread Matt Arsenault via cfe-commits
@@ -0,0 +1,24 @@ +// REQUIRES: amdgpu-registered-target arsenm wrote: Don't think it actually does https://github.com/llvm/llvm-project/pull/135027 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists

[clang] [Clang][AMDGPU] Accept builtins in lambda declarations (PR #135027)

2025-04-09 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-amdgpu Author: Juan Manuel Martinez Caamaño (jmmartinez) Changes `Sema::getCurFunctionDecl(AllowLambda = false)` returns a nullptr when the lambda declaration is outside a function (for example, when assigning a lambda to a static constexpr var

[clang] [Clang][AMDGPU] Accept builtins in lambda declarations (PR #135027)

2025-04-09 Thread Juan Manuel Martinez Caamaño via cfe-commits
https://github.com/jmmartinez created https://github.com/llvm/llvm-project/pull/135027 `Sema::getCurFunctionDecl(AllowLambda = false)` returns a nullptr when the lambda declaration is outside a function (for example, when assigning a lambda to a static constexpr variable). This triggered an a