[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-11 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/135120 >From 85001dcbc184491dfb24e9d2a39df46fd4c9a363 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Wed, 9 Apr 2025 18:17:26 -0700 Subject: [PATCH 1/5] Initialize resources by constructors - add resource record con

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-11 Thread Helena Kotas via cfe-commits
@@ -1,34 +1,117 @@ // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s --check-prefixes=CHECK,CHECK-DXIL +// FIXME: SPIR-V codegen of llvm.spv.resource.handlefrombinding and resource types is not yet implement

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-11 Thread Ashley Coleman via cfe-commits
https://github.com/V-FEXrt commented: LGTM but I don't have enough domain knowledge to approve https://github.com/llvm/llvm-project/pull/135120 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-11 Thread Ashley Coleman via cfe-commits
@@ -3179,6 +3207,67 @@ void SemaHLSL::ActOnVariableDeclarator(VarDecl *VD) { } } +static bool initVarDeclWithCtor(Sema &S, VarDecl *VD, +MutableArrayRef Args) { + InitializedEntity Entity = InitializedEntity::InitializeVariable(VD); + Initia

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-11 Thread Ashley Coleman via cfe-commits
https://github.com/V-FEXrt edited https://github.com/llvm/llvm-project/pull/135120 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-11 Thread Ashley Coleman via cfe-commits
@@ -1,34 +1,117 @@ // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s --check-prefixes=CHECK,CHECK-DXIL +// FIXME: SPIR-V codegen of llvm.spv.resource.handlefrombinding and resource types is not yet implement

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-11 Thread Ashley Coleman via cfe-commits
@@ -287,6 +287,24 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned BuiltinID, RetTy, CGM.getHLSLRuntime().getCreateResourceGetPointerIntrinsic(), ArrayRef{HandleOp, IndexOp}); } + case Builtin::BI__builtin_hlsl_resource_createpoisonhandle: { +llvm

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-11 Thread Ashley Coleman via cfe-commits
@@ -3179,6 +3207,67 @@ void SemaHLSL::ActOnVariableDeclarator(VarDecl *VD) { } } +static bool initVarDeclWithCtor(Sema &S, VarDecl *VD, +MutableArrayRef Args) { + InitializedEntity Entity = InitializedEntity::InitializeVariable(VD); + Initia

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-11 Thread Ashley Coleman via cfe-commits
@@ -3179,6 +3207,67 @@ void SemaHLSL::ActOnVariableDeclarator(VarDecl *VD) { } } +static bool initVarDeclWithCtor(Sema &S, VarDecl *VD, +MutableArrayRef Args) { + InitializedEntity Entity = InitializedEntity::InitializeVariable(VD); + Initia

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-11 Thread Helena Kotas via cfe-commits
@@ -287,6 +287,24 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned BuiltinID, RetTy, CGM.getHLSLRuntime().getCreateResourceGetPointerIntrinsic(), ArrayRef{HandleOp, IndexOp}); } + case Builtin::BI__builtin_hlsl_resource_createpoisonhandle: { +llvm

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-11 Thread Ashley Coleman via cfe-commits
@@ -287,6 +287,24 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned BuiltinID, RetTy, CGM.getHLSLRuntime().getCreateResourceGetPointerIntrinsic(), ArrayRef{HandleOp, IndexOp}); } + case Builtin::BI__builtin_hlsl_resource_createpoisonhandle: { +llvm

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-11 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/135120 >From 85001dcbc184491dfb24e9d2a39df46fd4c9a363 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Wed, 9 Apr 2025 18:17:26 -0700 Subject: [PATCH 1/4] Initialize resources by constructors - add resource record con

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-10 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp edited https://github.com/llvm/llvm-project/pull/135120 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-10 Thread Damyan Pepper via cfe-commits
@@ -89,12 +89,51 @@ RESOURCE Buffer; // CHECK-SAME{LITERAL}: [[hlsl::raw_buffer]] // CHECK-SAME{LITERAL}: [[hlsl::contained_type(element_type)]] +// Default constructor + +// CHECK: CXXConstructorDecl {{.*}} [[RESOURCE]] 'void ()' inline +// CHECK-NEXT: CompoundStmt +// CHECK-

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-10 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp commented: LGTM https://github.com/llvm/llvm-project/pull/135120 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-10 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff HEAD~1 HEAD --extensions h,cpp -- clang/include/clang/Sema/SemaHLSL.h clang/lib/CodeG

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-10 Thread Helena Kotas via cfe-commits
https://github.com/hekota ready_for_review https://github.com/llvm/llvm-project/pull/135120 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-09 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/135120 >From 85001dcbc184491dfb24e9d2a39df46fd4c9a363 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Wed, 9 Apr 2025 18:17:26 -0700 Subject: [PATCH 1/2] Initialize resources by constructors - add resource record con

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-09 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/135120 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-09 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/135120 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-09 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Helena Kotas (hekota) Changes - Adds resource constructor that takes explicit binding for all resource classes. - Updates implementation of default resource constructor to initialize resource handle to `poison`. - Removes initialization o

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-09 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/135120 >From 85001dcbc184491dfb24e9d2a39df46fd4c9a363 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Wed, 9 Apr 2025 18:17:26 -0700 Subject: [PATCH 1/3] Initialize resources by constructors - add resource record con

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-09 Thread Helena Kotas via cfe-commits
https://github.com/hekota created https://github.com/llvm/llvm-project/pull/135120 - Adds resource constructor that takes explicit binding for all resource classes. - Updates implementation of default resource constructor to initialize resource handle to `poison`. - Removes initialization of r