@@ -89,14 +99,57 @@ llvm::TargetExtType
*HLSLBufferLayoutBuilder::createLayoutType(
RecordTypes.pop_back();
for (const auto *FD : RT->getDecl()->fields()) {
- assert((!Packoffsets || Index < Packoffsets->size()) &&
- "number of elements in layout stru
@@ -174,21 +176,45 @@ createBufferHandleType(const HLSLBufferDecl *BufDecl) {
return cast(QT.getTypePtr());
}
+// Iterates over all declarations in the HLSL buffer and based on the
+// packoffset or register(c#) annotations it fills outs the Layout
+// vector with the user-s
@@ -174,21 +176,45 @@ createBufferHandleType(const HLSLBufferDecl *BufDecl) {
return cast(QT.getTypePtr());
}
+// Iterates over all declarations in the HLSL buffer and based on the
+// packoffset or register(c#) annotations it fills outs the Layout
alsepkow
@@ -174,21 +176,45 @@ createBufferHandleType(const HLSLBufferDecl *BufDecl) {
return cast(QT.getTypePtr());
}
+// Iterates over all declarations in the HLSL buffer and based on the
+// packoffset or register(c#) annotations it fills outs the Layout
+// vector with the user-s
@@ -89,14 +99,57 @@ llvm::TargetExtType
*HLSLBufferLayoutBuilder::createLayoutType(
RecordTypes.pop_back();
for (const auto *FD : RT->getDecl()->fields()) {
- assert((!Packoffsets || Index < Packoffsets->size()) &&
- "number of elements in layout stru
@@ -89,14 +99,57 @@ llvm::TargetExtType
*HLSLBufferLayoutBuilder::createLayoutType(
RecordTypes.pop_back();
for (const auto *FD : RT->getDecl()->fields()) {
- assert((!Packoffsets || Index < Packoffsets->size()) &&
- "number of elements in layout stru
@@ -89,14 +99,57 @@ llvm::TargetExtType
*HLSLBufferLayoutBuilder::createLayoutType(
RecordTypes.pop_back();
for (const auto *FD : RT->getDecl()->fields()) {
- assert((!Packoffsets || Index < Packoffsets->size()) &&
- "number of elements in layout stru
@@ -58,9 +60,15 @@ namespace CodeGen {
// classes) and calls layoutField to converts each field to its corresponding
// LLVM type and to calculate its HLSL constant buffer layout. Any embedded
// structs (or arrays of structs) are converted to target layout types as well.
+//
+
@@ -174,21 +176,45 @@ createBufferHandleType(const HLSLBufferDecl *BufDecl) {
return cast(QT.getTypePtr());
}
+// Iterates over all declarations in the HLSL buffer and based on the
+// packoffset or register(c#) annotations it fills outs the Layout
alsepkow
@@ -89,14 +99,57 @@ llvm::TargetExtType
*HLSLBufferLayoutBuilder::createLayoutType(
RecordTypes.pop_back();
for (const auto *FD : RT->getDecl()->fields()) {
- assert((!Packoffsets || Index < Packoffsets->size()) &&
- "number of elements in layout stru
https://github.com/alsepkow approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/130910
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/alsepkow updated
https://github.com/llvm/llvm-project/pull/147623
>From 7e1c62fce3741b8182db2428c29136524b27b98c Mon Sep 17 00:00:00 2001
From: Alex Sepkowski <5620315+alsep...@users.noreply.github.com>
Date: Tue, 8 Jul 2025 16:17:56 -0700
Subject: [PATCH 1/6] Numeric limits i
https://github.com/alsepkow updated
https://github.com/llvm/llvm-project/pull/147623
>From 7e1c62fce3741b8182db2428c29136524b27b98c Mon Sep 17 00:00:00 2001
From: Alex Sepkowski <5620315+alsep...@users.noreply.github.com>
Date: Tue, 8 Jul 2025 16:17:56 -0700
Subject: [PATCH 1/7] Numeric limits i
@@ -777,7 +779,7 @@ template <> struct
MappingTraits {
IO.mapOptional("Maximum", signedMaximum);
Space.Maximum = static_cast(signedMaximum);
-if (Space.Maximum != -1u)
+if (Space.Maximum != std::numeric_limits::max())
alsepkow wrote:
On furth
https://github.com/alsepkow edited
https://github.com/llvm/llvm-project/pull/146124
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,56 @@
+//===- RootSignatureMetadata.h - HLSL Root Signature helpers
--===//
+//
+// 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
https://github.com/alsepkow commented:
LGTM outside of a few minor comments you may choose to address or not.
https://github.com/llvm/llvm-project/pull/146124
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailma
@@ -103,7 +51,7 @@ class ResourceRange {
getOverlapping(const RangeInfo &Info) const;
// Return the mapped RangeInfo at X or nullptr if no mapping exists
- LLVM_ABI const RangeInfo *lookup(uint32_t X) const;
alsepkow wrote:
LLVM_ABI no longer needed?
h
@@ -0,0 +1,194 @@
+//===- RootSignatureMetadata.h - HLSL Root Signature helpers
--===//
+//
+// 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
@@ -155,6 +163,41 @@ std::optional
RootSignatureParser::parseRootConstants() {
return Constants;
}
+std::optional RootSignatureParser::parseRootParam() {
+ assert((CurToken.TokKind == TokenKind::kw_CBV ||
+ CurToken.TokKind == TokenKind::kw_SRV ||
+ CurTo
https://github.com/alsepkow edited
https://github.com/llvm/llvm-project/pull/154248
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,102 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.6-compute
-finclude-default-header \
+// RUN: -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s
+
+// CHECK: @[[BufA:.*]] = private unnamed_addr constant [2 x i8] c"A\00", align
1
+
+RWBuffer A[5][4][3][2]
@@ -0,0 +1,102 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.6-compute
-finclude-default-header \
+// RUN: -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s
+
+// CHECK: @[[BufA:.*]] = private unnamed_addr constant [2 x i8] c"A\00", align
1
+
+RWBuffer A[5][4][3][2]
https://github.com/alsepkow commented:
LGT-US (Alex, Finn, Deric). A few minor nits and a question.
https://github.com/llvm/llvm-project/pull/154248
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo
@@ -0,0 +1,62 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.6-compute
-finclude-default-header \
+// RUN: -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s
+
+// CHECK: @[[BufA:.*]] = private unnamed_addr constant [2 x i8] c"A\00", align
1
+
+RWBuffer A[4][2] : regi
@@ -802,16 +869,14 @@ std::optional
CGHLSLRuntime::emitResourceArraySubscriptExpr(
ArraySubsExpr->getType()->isHLSLResourceRecordArray() &&
"expected resource array subscript expression");
- // let clang codegen handle local resource array subscripts
-
@@ -0,0 +1,62 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.6-compute
-finclude-default-header \
+// RUN: -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s
+
+// CHECK: @[[BufA:.*]] = private unnamed_addr constant [2 x i8] c"A\00", align
1
+
+RWBuffer A[4][2] : regi
@@ -190,6 +192,71 @@ static void createResourceCtorArgs(CodeGenModule &CGM,
CXXConstructorDecl *CD,
Args.add(RValue::get(NameStr), AST.getPointerType(AST.CharTy.withConst()));
}
+// Initializes local resource array variable. For multi-dimensional arrays it
+// calls itself
@@ -0,0 +1,102 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.6-compute
-finclude-default-header \
+// RUN: -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s
+
+// CHECK: @[[BufA:.*]] = private unnamed_addr constant [2 x i8] c"A\00", align
1
+
+RWBuffer A[5][4][3][2]
29 matches
Mail list logo