@@ -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
@@ -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
@@ -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
@@ -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
@@ -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");
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
@@ -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
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
@@ -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
@@ -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
@@ -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
@@ -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
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
@@ -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
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
@@ -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");
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
@@ -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
@@ -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;
}
}
@@ -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
@@ -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
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
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
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
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
@@ -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
@@ -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
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
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
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
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
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
32 matches
Mail list logo