[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-14 Thread Helena Kotas via llvm-branch-commits
@@ -0,0 +1,39 @@ +//===- HLSLTargetInfo.h ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-14 Thread Helena Kotas via llvm-branch-commits
@@ -0,0 +1,49 @@ +; ModuleID = 'C:\llvm-project\clang\test\CodeGenHLSL\cbuffer_and_namespaces.hlsl' hekota wrote: This file should not be here at all ;). https://github.com/llvm/llvm-project/pull/124886 ___ llvm-bran

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-14 Thread Helena Kotas via llvm-branch-commits
@@ -0,0 +1,201 @@ +//===- HLSLTargetInto.cpp--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-14 Thread Helena Kotas via llvm-branch-commits
@@ -0,0 +1,201 @@ +//===- HLSLTargetInto.cpp--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-14 Thread Helena Kotas via llvm-branch-commits
@@ -56,9 +75,18 @@ llvm::Type *DirectXTargetCodeGenInfo::getHLSLType(CodeGenModule &CGM, return llvm::TargetExtType::get(Ctx, TypeName, {ElemType}, Ints); } - case llvm::dxil::ResourceClass::CBuffer: -llvm_unreachable("dx.CBuffer handles are not implemented yet");

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-12 Thread Farzon Lotfi via llvm-branch-commits
farzonl wrote: Really appreciate your judicious use of comments. Helped me understand why you were doing certain things. Most of what I found seemed minor so LGTM. https://github.com/llvm/llvm-project/pull/124886 ___ llvm-branch-commits mailing list

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-12 Thread Farzon Lotfi via llvm-branch-commits
@@ -0,0 +1,201 @@ +//===- HLSLTargetInto.cpp--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-12 Thread Farzon Lotfi via llvm-branch-commits
https://github.com/farzonl approved this pull request. https://github.com/llvm/llvm-project/pull/124886 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-12 Thread Farzon Lotfi via llvm-branch-commits
@@ -0,0 +1,49 @@ +; ModuleID = 'C:\llvm-project\clang\test\CodeGenHLSL\cbuffer_and_namespaces.hlsl' farzonl wrote: delete? https://github.com/llvm/llvm-project/pull/124886 ___ llvm-branch-commits mailing list llvm-bra

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-12 Thread Farzon Lotfi via llvm-branch-commits
@@ -0,0 +1,49 @@ +; ModuleID = 'C:\llvm-project\clang\test\CodeGenHLSL\cbuffer_and_namespaces.hlsl' +source_filename = "C:\\llvm-project\\clang\\test\\CodeGenHLSL\\cbuffer_and_namespaces.hlsl" farzonl wrote: delete? https://github.com/llvm/llvm-project/pull/12

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-12 Thread Farzon Lotfi via llvm-branch-commits
@@ -0,0 +1,39 @@ +//===- HLSLTargetInfo.h ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-12 Thread Farzon Lotfi via llvm-branch-commits
@@ -0,0 +1,201 @@ +//===- HLSLTargetInto.cpp--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-12 Thread Farzon Lotfi via llvm-branch-commits
https://github.com/farzonl edited https://github.com/llvm/llvm-project/pull/124886 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-12 Thread Farzon Lotfi via llvm-branch-commits
@@ -0,0 +1,201 @@ +//===- HLSLTargetInto.cpp--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-12 Thread Farzon Lotfi via llvm-branch-commits
https://github.com/farzonl edited https://github.com/llvm/llvm-project/pull/124886 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-12 Thread Farzon Lotfi via llvm-branch-commits
@@ -56,9 +75,18 @@ llvm::Type *DirectXTargetCodeGenInfo::getHLSLType(CodeGenModule &CGM, return llvm::TargetExtType::get(Ctx, TypeName, {ElemType}, Ints); } - case llvm::dxil::ResourceClass::CBuffer: -llvm_unreachable("dx.CBuffer handles are not implemented yet");

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-10 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota converted_to_draft https://github.com/llvm/llvm-project/pull/124886 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-07 Thread Damyan Pepper via llvm-branch-commits
@@ -0,0 +1,199 @@ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-compute \ +// RUN: -fnative-half-type -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s + +// CHECK: %struct.__cblayout_CBScalars = type <{ float, double, half, i64, i32, i16, i

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-07 Thread Damyan Pepper via llvm-branch-commits
@@ -257,8 +258,10 @@ static void validatePackoffset(Sema &S, HLSLBufferDecl *BufDecl) { VarDecl *NextVar = PackOffsetVec[i + 1].first; S.Diag(NextVar->getLocation(), diag::err_hlsl_packoffset_overlap) << NextVar << Var; + IsValid = false; } }

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-07 Thread Damyan Pepper via llvm-branch-commits
@@ -5032,6 +5032,11 @@ class HLSLBufferDecl final : public NamedDecl, public DeclContext { SourceLocation KwLoc; /// IsCBuffer - Whether the buffer is a cbuffer (and not a tbuffer). bool IsCBuffer; + /// HasValidPackoffset - Whether the buffer has valid packoffset annot

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-07 Thread Damyan Pepper via llvm-branch-commits
@@ -0,0 +1,199 @@ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-compute \ +// RUN: -fnative-half-type -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s + +// CHECK: %struct.__cblayout_CBScalars = type <{ float, double, half, i64, i32, i16, i

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

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

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-04 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/124886 >From cf08adb6b9e181613e81d2cfbadbbb68e645fe33 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Tue, 28 Jan 2025 14:46:26 -0800 Subject: [PATCH 1/4] [HLSL] Translate cbuffer declarations to target type dx.CBuff

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-04 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/124886 >From cf08adb6b9e181613e81d2cfbadbbb68e645fe33 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Tue, 28 Jan 2025 14:46:26 -0800 Subject: [PATCH 1/4] [HLSL] Translate cbuffer declarations to target type dx.CBuff

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

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

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-04 Thread Helena Kotas via llvm-branch-commits
@@ -5743,6 +5747,17 @@ HLSLBufferDecl *HLSLBufferDecl::CreateDeserialized(ASTContext &C, SourceLocation(), SourceLocation()); } +const CXXRecordDecl *HLSLBufferDecl::getLayoutStruct() const { + // Layout struct is the last decl in the HLSL

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-04 Thread Justin Bogner via llvm-branch-commits
@@ -5743,6 +5747,17 @@ HLSLBufferDecl *HLSLBufferDecl::CreateDeserialized(ASTContext &C, SourceLocation(), SourceLocation()); } +const CXXRecordDecl *HLSLBufferDecl::getLayoutStruct() const { + // Layout struct is the last decl in the HLSL

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-01-31 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/124886 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-01-28 Thread via llvm-branch-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Helena Kotas (hekota) Changes Translates `cbuffer` declaration blocks to `target("dx.CBuffer")` type. Creates global variables in `hlsl_constant` address space for all `cbuffer` constant and adds metadata describing which global c

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-01-28 Thread via llvm-branch-commits
llvmbot wrote: @llvm/pr-subscribers-hlsl Author: Helena Kotas (hekota) Changes Translates `cbuffer` declaration blocks to `target("dx.CBuffer")` type. Creates global variables in `hlsl_constant` address space for all `cbuffer` constant and adds metadata describing which global constant b

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-01-28 Thread via llvm-branch-commits
llvmbot wrote: @llvm/pr-subscribers-backend-directx Author: Helena Kotas (hekota) Changes Translates `cbuffer` declaration blocks to `target("dx.CBuffer")` type. Creates global variables in `hlsl_constant` address space for all `cbuffer` constant and adds metadata describing which global

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-01-28 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota ready_for_review https://github.com/llvm/llvm-project/pull/124886 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits