https://github.com/bogner edited
https://github.com/llvm/llvm-project/pull/139963
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -1157,3 +1157,49 @@ TEST(RootSignature, ParseDescriptorTable) {
ASSERT_EQ(Range.OffsetInDescriptorsFromTableStart, -1);
}
}
+
+TEST(RootSignature, ParseStaticSamplers) {
+ {
+uint8_t Buffer[] = {
+0x44, 0x58, 0x42, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
https://github.com/bogner approved this pull request.
LGTM other than one comment about consistently using the `ASSERT_*` vs
`EXPECT_*` macros in the tests.
https://github.com/llvm/llvm-project/pull/139963
___
llvm-branch-commits mailing list
llvm-bra
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/140294
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -198,6 +199,61 @@ class MetadataBuilder {
SmallVector GeneratedMetadata;
};
+// RangeInfo holds the information to correctly construct a ResourceRange
+// and retains this information to be used for displaying a better diagnostic
+struct RangeInfo {
+ const static uint32
@@ -198,6 +199,61 @@ class MetadataBuilder {
SmallVector GeneratedMetadata;
};
+// RangeInfo holds the information to correctly construct a ResourceRange
+// and retains this information to be used for displaying a better diagnostic
+struct RangeInfo {
+ const static uint32
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/140957
___
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/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/140645
___
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/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/140642
___
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/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/140306
___
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/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/140305
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -104,10 +107,11 @@ KEYWORD(numDescriptors)
KEYWORD(offset)
// StaticSampler Keywords:
-KEYWORD(mipLODBias)
+KEYWORD(filter)
KEYWORD(addressU)
KEYWORD(addressV)
KEYWORD(addressW)
+KEYWORD(mipLODBias)
KEYWORD(maxAnisotropy)
KEYWORD(minLOD)
KEYWORD(maxLOD)
--
@@ -76,6 +76,45 @@ enum class ShaderVisibility {
Mesh = 7,
};
+enum class Filter {
+ MinMagMipPoint = 0,
+ MinMagPointMipLinear = 0x1,
+ MinPointMagLinearMipPoint = 0x4,
+ MinPointMagMipLinear = 0x5,
+ MinLinearMagMipPoint = 0x10,
+ MinLinearMagPointMipLinear = 0x11,
+
@@ -6,6 +6,8 @@
//
//===--===//
+#include
bogner wrote:
Is this used?
https://github.com/llvm/llvm-project/pull/140181
___
llvm-branch-commits m
@@ -821,22 +873,115 @@ std::optional
RootSignatureParser::handleUIntLiteral() {
PP.getSourceManager(), PP.getLangOpts(),
PP.getTargetInfo(), PP.getDiagnostics());
if (Literal.hadError)
-return tr
@@ -821,22 +873,115 @@ std::optional
RootSignatureParser::handleUIntLiteral() {
PP.getSourceManager(), PP.getLangOpts(),
PP.getTargetInfo(), PP.getDiagnostics());
if (Literal.hadError)
-return tr
@@ -711,6 +734,35 @@ std::optional
RootSignatureParser::parseRegister() {
return Reg;
}
+std::optional RootSignatureParser::parseFloatParam() {
+ assert(CurToken.TokKind == TokenKind::pu_equal &&
+ "Expects to only be invoked starting at given keyword");
+ // Cons
@@ -821,22 +873,115 @@ std::optional
RootSignatureParser::handleUIntLiteral() {
PP.getSourceManager(), PP.getLangOpts(),
PP.getTargetInfo(), PP.getDiagnostics());
if (Literal.hadError)
-return tr
@@ -821,22 +873,115 @@ std::optional
RootSignatureParser::handleUIntLiteral() {
PP.getSourceManager(), PP.getLangOpts(),
PP.getTargetInfo(), PP.getDiagnostics());
if (Literal.hadError)
-return tr
@@ -821,22 +873,115 @@ std::optional
RootSignatureParser::handleUIntLiteral() {
PP.getSourceManager(), PP.getLangOpts(),
PP.getTargetInfo(), PP.getDiagnostics());
if (Literal.hadError)
-return tr
@@ -711,6 +734,35 @@ std::optional
RootSignatureParser::parseRegister() {
return Reg;
}
+std::optional RootSignatureParser::parseFloatParam() {
+ assert(CurToken.TokKind == TokenKind::pu_equal &&
+ "Expects to only be invoked starting at given keyword");
+ // Cons
@@ -821,22 +873,115 @@ std::optional
RootSignatureParser::handleUIntLiteral() {
PP.getSourceManager(), PP.getLangOpts(),
PP.getTargetInfo(), PP.getDiagnostics());
if (Literal.hadError)
-return tr
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/140180
___
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/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/141173
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -539,19 +537,27 @@ static void initializeBuffer(CodeGenModule &CGM,
llvm::GlobalVariable *GV,
}
static void initializeBufferFromBinding(CodeGenModule &CGM,
-llvm::GlobalVariable *GV, unsigned
Slot,
-
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/137690
___
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/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/114104
___
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/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/138043
___
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/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/138007
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -1842,5 +1842,6 @@ def err_hlsl_unexpected_end_of_params
def err_hlsl_rootsig_repeat_param : Error<"specified the same parameter '%0'
multiple times">;
def err_hlsl_rootsig_missing_param : Error<"did not specify mandatory
parameter '%0'">;
def err_hlsl_number_literal_overf
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/138055
___
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/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/138002
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -149,6 +149,29 @@ void DescriptorTableClause::dump(raw_ostream &OS) const {
OS << ")";
}
+// Helper struct so that we can use the overloaded notation of std::visit
+template struct OverloadMethods : Ts... {
+ using Ts::operator()...;
+};
+
+template OverloadMethods(Ts.
@@ -149,6 +149,29 @@ void DescriptorTableClause::dump(raw_ostream &OS) const {
OS << ")";
}
+// Helper struct so that we can use the overloaded notation of std::visit
+template struct OverloadMethods : Ts... {
+ using Ts::operator()...;
+};
+
+template OverloadMethods(Ts.
https://github.com/bogner updated
https://github.com/llvm/llvm-project/pull/137877
>From 20a1723d5f4f9132e44ba7d76e11f94ca367e269 Mon Sep 17 00:00:00 2001
From: Justin Bogner
Date: Tue, 29 Apr 2025 11:59:37 -0700
Subject: [PATCH 1/2] [HLSL] Overloads for `lerp` with a scalar weight
This adds o
https://github.com/bogner updated
https://github.com/llvm/llvm-project/pull/137877
>From 20a1723d5f4f9132e44ba7d76e11f94ca367e269 Mon Sep 17 00:00:00 2001
From: Justin Bogner
Date: Tue, 29 Apr 2025 11:59:37 -0700
Subject: [PATCH] [HLSL] Overloads for `lerp` with a scalar weight
This adds overl
https://github.com/bogner edited
https://github.com/llvm/llvm-project/pull/137877
___
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/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/137038
___
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/bogner approved this pull request.
LGTM!
https://github.com/llvm/llvm-project/pull/135287
___
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/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/136751
___
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/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/130338
___
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/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/130342
___
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/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/130323
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -99,18 +96,6 @@ static NamedMDNode *emitResourceMetadata(Module &M,
DXILBindingMap &DBM,
Metadata *SmpMD = Smps.empty() ? nullptr : MDNode::get(Context, Smps);
bool HasResources = !DBM.empty();
- if (MDResources.hasUAVs()) {
-assert(!UAVMD && "Old and new UAV repr
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/128577
___
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/bogner updated
https://github.com/llvm/llvm-project/pull/128699
>From be9554eabde52e6feb37ad91935ee73aacdf00d6 Mon Sep 17 00:00:00 2001
From: Justin Bogner
Date: Sat, 22 Feb 2025 12:40:46 -0800
Subject: [PATCH 1/2] [DirectX] Support the CBufferLoadLegacy operation
Fixes #112
https://github.com/bogner created
https://github.com/llvm/llvm-project/pull/128699
Fixes #112992
>From be9554eabde52e6feb37ad91935ee73aacdf00d6 Mon Sep 17 00:00:00 2001
From: Justin Bogner
Date: Sat, 22 Feb 2025 12:40:46 -0800
Subject: [PATCH] [DirectX] Support the CBufferLoadLegacy operation
https://github.com/bogner created
https://github.com/llvm/llvm-project/pull/128698
Make sure we're able to print cbuffer comments in a way that's compatible with
DXC.
Fixes #128562
>From 155483b100e7e60d62b966dfd56747a2c64a94dd Mon Sep 17 00:00:00 2001
From: Justin Bogner
Date: Sat, 22 Feb 2
@@ -7,19 +7,42 @@
//===--===//
#include "llvm/BinaryFormat/DXContainer.h"
-#include
-#include
+#include "llvm/Support/BinaryStreamWriter.h"
+#include "llvm/Support/raw_ostream.h"
+#include
+#include
-
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/125807
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -162,5 +219,371 @@ std::optional
RootSignatureLexer::PeekNextToken() {
return Result;
}
+// Parser Definitions
+
+RootSignatureParser::RootSignatureParser(SmallVector &Elements,
+ RootSignatureLexer &Lexer,
+
@@ -93,6 +96,108 @@ class RootSignatureLexer {
}
};
+class RootSignatureParser {
+public:
+ RootSignatureParser(SmallVector &Elements,
+ RootSignatureLexer &Lexer, DiagnosticsEngine &Diags);
+
+ /// Iterates over the provided tokens and constructs the
@@ -162,5 +219,371 @@ std::optional
RootSignatureLexer::PeekNextToken() {
return Result;
}
+// Parser Definitions
+
+RootSignatureParser::RootSignatureParser(SmallVector &Elements,
+ RootSignatureLexer &Lexer,
+
@@ -162,5 +219,371 @@ std::optional
RootSignatureLexer::PeekNextToken() {
return Result;
}
+// Parser Definitions
+
+RootSignatureParser::RootSignatureParser(SmallVector &Elements,
+ RootSignatureLexer &Lexer,
+
@@ -93,6 +96,108 @@ class RootSignatureLexer {
}
};
+class RootSignatureParser {
+public:
+ RootSignatureParser(SmallVector &Elements,
+ RootSignatureLexer &Lexer, DiagnosticsEngine &Diags);
+
+ /// Iterates over the provided tokens and constructs the
@@ -306,4 +307,254 @@ TEST_F(ParseHLSLRootSignatureTest,
InvalidLexRegNumberTest) {
ASSERT_FALSE(Consumer->IsSatisfied());
}
+// Valid Parser Tests
+
+TEST_F(ParseHLSLRootSignatureTest, ValidParseEmptyTest) {
+ const llvm::StringLiteral Source = R"cc()cc";
+
+ TrivialModu
@@ -1,8 +1,65 @@
#include "clang/Parse/ParseHLSLRootSignature.h"
+#include "llvm/Support/raw_ostream.h"
+
+using namespace llvm::hlsl::rootsig;
+
namespace clang {
namespace hlsl {
+// Helper definitions
bogner wrote:
This comment isn't very helpful.
http
@@ -93,6 +96,108 @@ class RootSignatureLexer {
}
};
+class RootSignatureParser {
+public:
+ RootSignatureParser(SmallVector &Elements,
+ RootSignatureLexer &Lexer, DiagnosticsEngine &Diags);
+
+ /// Iterates over the provided tokens and constructs the
@@ -93,6 +96,108 @@ class RootSignatureLexer {
}
};
+class RootSignatureParser {
+public:
+ RootSignatureParser(SmallVector &Elements,
+ RootSignatureLexer &Lexer, DiagnosticsEngine &Diags);
+
+ /// Iterates over the provided tokens and constructs the
@@ -93,6 +96,108 @@ class RootSignatureLexer {
}
};
+class RootSignatureParser {
+public:
+ RootSignatureParser(SmallVector &Elements,
+ RootSignatureLexer &Lexer, DiagnosticsEngine &Diags);
+
+ /// Iterates over the provided tokens and constructs the
@@ -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
@@ -0,0 +1,157 @@
+//===- DXILRootSignature.cpp - DXIL Root Signature helper objects ===//
+//
+// 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: Apache-2
@@ -15,16 +15,21 @@
#include "clang/AST/APValue.h"
#include "clang/Basic/DiagnosticLex.h"
+#include "clang/Basic/DiagnosticParse.h"
#include "clang/Lex/LiteralSupport.h"
#include "clang/Lex/Preprocessor.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
@@ -148,6 +148,347 @@ bool RootSignatureLexer::LexToken(RootSignatureToken
&Result) {
return false;
}
+// Parser Definitions
+
+RootSignatureParser::RootSignatureParser(
+SmallVector &Elements,
+const SmallVector &Tokens)
+: Elements(Elements) {
+ CurTok = Toke
@@ -80,6 +85,99 @@ class RootSignatureLexer {
}
};
+class RootSignatureParser {
+public:
+ RootSignatureParser(SmallVector &Elements,
+ const SmallVector &Tokens,
+ DiagnosticsEngine &Diags);
+
+ // Iterates over the provided token
@@ -80,6 +85,99 @@ class RootSignatureLexer {
}
};
+class RootSignatureParser {
+public:
+ RootSignatureParser(SmallVector &Elements,
+ const SmallVector &Tokens,
+ DiagnosticsEngine &Diags);
+
+ // Iterates over the provided token
https://github.com/bogner created
https://github.com/llvm/llvm-project/pull/121725
This adds handling for raw and structured buffers when lowering resource access
via `llvm.dx.resource.getpointer`.
Fixes #121714
>From 192d20b16e418b89a549e93406f782ac0a0fa093 Mon Sep 17 00:00:00 2001
From: Jus
bogner wrote:
> ⚠️ undef deprecator found issues in your code. ⚠️
>
> You can test this locally with the following command:
> The following files introduce new uses of undef:
>
> * llvm/lib/Target/DirectX/DXILOpLowering.cpp
> * llvm/test/CodeGen/DirectX/BufferStore-sm61.ll
> * llvm/test/CodeGe
https://github.com/bogner created
https://github.com/llvm/llvm-project/pull/121282
This introduces `@llvm.dx.resource.store.rawbuffer` and generalizes the buffer
store docs under DirectX/DXILResources.
Fixes #106188
>From c49bc4714589cf548a6382ea5a99f31626d3d6a2 Mon Sep 17 00:00:00 2001
From:
https://github.com/bogner updated
https://github.com/llvm/llvm-project/pull/121012
>From 53bba63c6a55464ac1872dc60f39510eff426d64 Mon Sep 17 00:00:00 2001
From: Justin Bogner
Date: Thu, 19 Dec 2024 16:33:48 -0700
Subject: [PATCH 1/2] [DirectX] Implement the resource.load.rawbuffer intrinsic
Th
@@ -542,6 +542,48 @@ class OpLowerer {
});
}
+ [[nodiscard]] bool lowerRawBufferLoad(Function &F) {
+Triple TT(Triple(M.getTargetTriple()));
+VersionTuple DXILVersion = TT.getDXILVersion();
+const DataLayout &DL = F.getDataLayout();
+IRBuilder<> &IRB = O
https://github.com/bogner created
https://github.com/llvm/llvm-project/pull/121012
This introduces `@llvm.dx.resource.load.rawbuffer` and generalizes the buffer
load docs under DirectX/DXILResources.
This resolves the "load" parts of #106188
>From 53bba63c6a55464ac1872dc60f39510eff426d64 Mon
bogner wrote:
oops, forgot to update the destination branch - identical PR here: #120477
https://github.com/llvm/llvm-project/pull/120280
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/lis
https://github.com/bogner closed
https://github.com/llvm/llvm-project/pull/120280
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -303,44 +289,157 @@ class ResourceInfo {
dxil::SamplerFeedbackType getFeedbackType() const;
uint32_t getMultiSampleCount() const;
- StringRef getName() const {
-// TODO: Get the name from the symbol once we include one here.
-return "";
- }
dxil::ResourceCl
@@ -303,44 +289,157 @@ class ResourceInfo {
dxil::SamplerFeedbackType getFeedbackType() const;
uint32_t getMultiSampleCount() const;
- StringRef getName() const {
-// TODO: Get the name from the symbol once we include one here.
-return "";
- }
dxil::ResourceCl
bogner wrote:
> If there already is a global variable for the resource in the module,
> shouldn't we be using that instead of creating a new symbol?
The only global variables in the module before this point are the globals for
the resource handles. These are (1) the wrong type (they're the han
@@ -0,0 +1,48 @@
+; RUN: opt -S -passes=dxil-translate-metadata %s | FileCheck %s
+
+target triple = "dxil-pc-shadermodel6.6-compute"
+
+%struct.S = type { <4 x float>, <4 x i32> }
+
+define void @test() {
+ ; Buffer
+ %float4 = call target("dx.TypedBuffer", <4 x float>, 0, 0, 0
@@ -10,10 +10,11 @@
; CHECK-NEXT: DXIL Intrinsic Expansion
; CHECK-NEXT: DXIL Data Scalarization
; CHECK-NEXT: DXIL Array Flattener
+; CHECK-NEXT: DXIL Resource analysis
bogner wrote:
This is no longer relevant after splitting the analysis passes
http
https://github.com/bogner edited
https://github.com/llvm/llvm-project/pull/116726
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -189,12 +189,28 @@ struct BuiltinTypeDeclBuilder {
BuiltinTypeDeclBuilder &addArraySubscriptOperators(Sema &S) {
if (Record->isCompleteDefinition())
return *this;
-addArraySubscriptOperator(S, true);
-addArraySubscriptOperator(S, false);
+ASTContext &
https://github.com/bogner updated
https://github.com/llvm/llvm-project/pull/117018
>From c7ba48c605a8181fb8c73178ea82b231b7e24e28 Mon Sep 17 00:00:00 2001
From: Justin Bogner
Date: Tue, 19 Nov 2024 14:32:44 -0800
Subject: [PATCH 1/2] [HLSL] Add RWBuffer::Load(Index)
This method is the same as
https://github.com/bogner created
https://github.com/llvm/llvm-project/pull/117018
This method is the same as `operator[]`, except that it returns a value instead
of a reference.
>From 8c9d382ae6d3c6e2dc8a0d738a97f3b3d14d5413 Mon Sep 17 00:00:00 2001
From: Justin Bogner
Date: Tue, 19 Nov 2024
@@ -94,6 +95,7 @@ class OpLowerer {
DiagnosticInfoUnsupported Diag(*CI->getFunction(), Message,
CI->getDebugLoc());
M.getContext().diagnose(Diag);
+HasErrors = true;
bogner wrote:
I pushed the `boo
https://github.com/bogner updated
https://github.com/llvm/llvm-project/pull/104253
>From d49a863313c30d3e75205dbffddc8f81980ed25b Mon Sep 17 00:00:00 2001
From: Justin Bogner
Date: Mon, 9 Sep 2024 17:55:15 -0700
Subject: [PATCH] Propagate HasErrors through return values
Created using spr 1.3.5
@@ -289,6 +289,43 @@ class OpLowerer {
});
}
+ void lowerTypedBufferStore(Function &F) {
+IRBuilder<> &IRB = OpBuilder.getIRB();
+Type *Int8Ty = IRB.getInt8Ty();
+Type *Int32Ty = IRB.getInt32Ty();
+
+replaceFunction(F, [&](CallInst *CI) -> Error {
--
@@ -94,6 +95,7 @@ class OpLowerer {
DiagnosticInfoUnsupported Diag(*CI->getFunction(), Message,
CI->getDebugLoc());
M.getContext().diagnose(Diag);
+HasErrors = true;
bogner wrote:
Even if we did pa
@@ -289,6 +289,43 @@ class OpLowerer {
});
}
+ void lowerTypedBufferStore(Function &F) {
+IRBuilder<> &IRB = OpBuilder.getIRB();
+Type *Int8Ty = IRB.getInt8Ty();
+Type *Int32Ty = IRB.getInt32Ty();
+
+replaceFunction(F, [&](CallInst *CI) -> Error {
--
https://github.com/bogner updated
https://github.com/llvm/llvm-project/pull/104253
___
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/bogner updated
https://github.com/llvm/llvm-project/pull/104253
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -388,10 +432,13 @@ class OpLowerer {
case Intrinsic::dx_typedBufferLoad:
lowerTypedBufferLoad(F);
break;
+ case Intrinsic::dx_typedBufferStore:
+lowerTypedBufferStore(F);
+break;
}
Updated = true;
}
-if (Updat
bogner wrote:
Please take another look - specifically I'd like some review on the doc changes
to make sure they're clear.
https://github.com/llvm/llvm-project/pull/104253
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://
@@ -289,6 +289,43 @@ class OpLowerer {
});
}
+ void lowerTypedBufferStore(Function &F) {
+IRBuilder<> &IRB = OpBuilder.getIRB();
+Type *Int8Ty = IRB.getInt8Ty();
+Type *Int32Ty = IRB.getInt32Ty();
+
+replaceFunction(F, [&](CallInst *CI) -> Error {
+
@@ -259,6 +259,114 @@ class OpLowerer {
lowerToBindAndAnnotateHandle(F);
}
+ /// Replace uses of \c V with the values in the `dx.ResRet` of \c Op. Since
we
+ /// expect to be post-scalarization, make an effort to avoid vectors.
+ Error replaceResRetUses(CallInst *I
https://github.com/bogner updated
https://github.com/llvm/llvm-project/pull/104252
>From 2f317012985068f7130cdf4976d8821924d404c3 Mon Sep 17 00:00:00 2001
From: Justin Bogner
Date: Mon, 9 Sep 2024 12:16:36 -0700
Subject: [PATCH 1/2] Improve comments, move code for clarity
Created using spr 1.3
@@ -259,6 +259,114 @@ class OpLowerer {
lowerToBindAndAnnotateHandle(F);
}
+ /// Replace uses of \c V with the values in the `dx.ResRet` of \c Op. Since
we
bogner wrote:
Nice catch, should be "Intrin", the name of the first parameter. Updated.
http
@@ -267,45 +267,38 @@ Examples:
@llvm.dx.handle.fromHeap.tdx.RawBuffer_v4f32_1_0(
i32 2, i1 false)
-Buffer Loads and Stores
-
-*relevant types: Buffers*
-
-We need to treat buffer loads and stores from "dx.TypedBuffer"
https://github.com/bogner updated
https://github.com/llvm/llvm-project/pull/104252
>From 2f317012985068f7130cdf4976d8821924d404c3 Mon Sep 17 00:00:00 2001
From: Justin Bogner
Date: Mon, 9 Sep 2024 12:16:36 -0700
Subject: [PATCH] Improve comments, move code for clarity
Created using spr 1.3.5-b
@@ -450,6 +462,10 @@ CallInst *DXILOpBuilder::createOp(dxil::OpCode OpCode,
ArrayRef Args,
return *Result;
}
+StructType *DXILOpBuilder::getResRetType(Type *ElementTy) {
+ return ::getResRetType(ElementTy);
bogner wrote:
This pattern isn't great, and I ex
@@ -30,6 +30,9 @@ def int_dx_handle_fromBinding
[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i1_ty],
[IntrNoMem]>;
+def int_dx_typedBufferLoad
bogner wrote:
No, I plan to add that in a follow up.
https://github.com/llvm/llvm-
1 - 100 of 274 matches
Mail list logo