@@ -483,10 +583,103 @@ static BuiltinTypeDeclBuilder
setupBufferType(CXXRecordDecl *Decl, Sema &S,
.addDefaultHandleConstructor(S, RC);
}
+BinaryOperator *constructSizeOfLEQ16Expr(ASTContext &Context,
+ SourceLocation NameLoc,
+
@@ -483,10 +583,103 @@ static BuiltinTypeDeclBuilder
setupBufferType(CXXRecordDecl *Decl, Sema &S,
.addDefaultHandleConstructor(S, RC);
}
+BinaryOperator *constructSizeOfLEQ16Expr(ASTContext &Context,
+ SourceLocation NameLoc,
+
@@ -1206,6 +1202,21 @@ class SPIRVStructurizer : public FunctionPass {
AU.addPreserved();
FunctionPass::getAnalysisUsage(AU);
}
+
+ void createOpSelectMerge(IRBuilder<> *Builder, BlockAddress *MergeAddress) {
+Instruction *BBTerminatorInst = Builder->GetInsertBlo
@@ -300,6 +301,36 @@ static MDTuple *emitTopLevelLibraryNode(Module &M, MDNode
*RMD,
return constructEntryMetadata(nullptr, nullptr, RMD, Properties, Ctx);
}
+// TODO: We might need to refactor this to be more generic,
+// in case we need more metadata to be replaced.
+stat
@@ -2694,19 +2694,49 @@ bool SPIRVInstructionSelector::selectIntrinsic(Register
ResVReg,
}
return MIB.constrainAllUses(TII, TRI, RBI);
}
- case Intrinsic::spv_loop_merge:
- case Intrinsic::spv_selection_merge: {
-const auto Opcode = IID == Intrinsic::spv_select
@@ -5322,6 +5324,11 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo
&CallInfo,
IRCallArgs[FirstIRArg] = Val;
break;
}
+ } else if (I->getType()->isArrayParameterType()) {
+// use the tmp created by the HLSLOutArgExpr
+/
https://github.com/llvm-beanz approved this pull request.
https://github.com/llvm/llvm-project/pull/111047
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/llvm-beanz approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/117885
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -2021,28 +2021,10 @@ llvm::DISubroutineType
*CGDebugInfo::getOrCreateInstanceMethodType(
// ThisPtr may be null if the member function has an explicit 'this'
// parameter.
if (!ThisPtr.isNull()) {
-const CXXRecordDecl *RD = ThisPtr->getPointeeCXXRecordDecl();
-
https://github.com/llvm-beanz created
https://github.com/llvm/llvm-project/pull/121025
Have you ever had that horrible realization that some header you included
defines a macro that matches a commonly used word that appears throughout your
codebase? What kind of horrible person would define `m
@@ -1531,7 +1531,7 @@ Compilation *Driver::BuildCompilation(ArrayRef ArgList) {
// Check if the environment version is valid except wasm case.
llvm::Triple Triple = TC.getTriple();
- if (!Triple.isWasm()) {
+ if (!Triple.isWasm() && Triple.getEnvironment() != llvm::Tripl
@@ -1,73 +1,151 @@
-// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
-// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \
-// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \
-// RUN: --check-prefixes=CHECK,NATIVE_HALF
-// RUN: %clang_cc1 -
https://github.com/llvm-beanz commented:
I don't love the way you re-wrote clang/test/CodeGenHLSL/builtins/length.hlsl.
I'm not a huge fan of the `update_cc_test_checks` workflow, and (as I commented
elsewhere) I really don't like tests that depend on optimizations.
I'm okay with removing the
https://github.com/llvm-beanz approved this pull request.
https://github.com/llvm/llvm-project/pull/121611
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/llvm-beanz approved this pull request.
https://github.com/llvm/llvm-project/pull/119041
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,139 @@
+#include "clang/Sema/ParseHLSLRootSignature.h"
+
+namespace llvm {
+namespace hlsl {
+namespace root_signature {
+
+// TODO: Hook up with Sema to properly report semantic/validation errors
+bool Parser::ReportError() { return true; }
+
+bool Parser::ParseRootFla
https://github.com/llvm-beanz commented:
Is there a reason that you're just operating on a StringRef buffer instead of
building out a proper tokenizer and parser? It seems to me like root signature
parsing probably warrants full lexer and parser that operates on tokens rather
than just section
https://github.com/llvm-beanz edited
https://github.com/llvm/llvm-project/pull/121799
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/llvm-beanz approved this pull request.
https://github.com/llvm/llvm-project/pull/116331
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -8010,15 +8010,19 @@ void Clang::ConstructJob(Compilation &C, const
JobAction &JA,
}
}
- if (Args.hasArg(options::OPT_forder_file_instrumentation)) {
- CmdArgs.push_back("-forder-file-instrumentation");
- // Enable order file instrumentation when ThinLTO is
https://github.com/llvm-beanz approved this pull request.
https://github.com/llvm/llvm-project/pull/121309
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/llvm-beanz approved this pull request.
https://github.com/llvm/llvm-project/pull/118580
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
llvm-beanz wrote:
> I didn't implement the tokenizer because I found that the extra level of
> abstraction to be redundant/not beneficial with the StringRef operations.
I disagree, and generally string operations tend to muddy up and can lead to
inefficiencies.
> Looking at the DXC implementa
@@ -8010,15 +8010,19 @@ void Clang::ConstructJob(Compilation &C, const
JobAction &JA,
}
}
- if (Args.hasArg(options::OPT_forder_file_instrumentation)) {
- CmdArgs.push_back("-forder-file-instrumentation");
- // Enable order file instrumentation when ThinLTO is
@@ -0,0 +1,171 @@
+#include "clang/Parse/ParseHLSLRootSignature.h"
+
+namespace clang {
+namespace hlsl {
+
+// Lexer Definitions
+
+static bool IsNumberChar(char C) {
+ // TODO(#120472): extend for float support exponents
+ return isdigit(C); // integer support
+}
+
+bool RootS
@@ -0,0 +1,171 @@
+#include "clang/Parse/ParseHLSLRootSignature.h"
+
+namespace clang {
+namespace hlsl {
+
+// Lexer Definitions
+
+static bool IsNumberChar(char C) {
+ // TODO(#120472): extend for float support exponents
+ return isdigit(C); // integer support
+}
+
+bool RootS
@@ -0,0 +1,171 @@
+#include "clang/Parse/ParseHLSLRootSignature.h"
+
+namespace clang {
+namespace hlsl {
+
+// Lexer Definitions
+
+static bool IsNumberChar(char C) {
+ // TODO(#120472): extend for float support exponents
+ return isdigit(C); // integer support
+}
+
+bool RootS
@@ -0,0 +1,151 @@
+#include "clang/Parse/ParseHLSLRootSignature.h"
+
+namespace llvm {
+namespace hlsl {
+namespace root_signature {
+
+// Lexer Definitions
+
+static bool IsPreprocessorNumberChar(char C) {
+ // TODO: extend for float support with or without hexadecimal/exponent
@@ -1017,4 +1017,15 @@ Error<"'#pragma unsafe_buffer_usage' was not ended">;
def err_pp_pragma_unsafe_buffer_usage_syntax :
Error<"expected 'begin' or 'end'">;
+
+// HLSL Root Signature Lexing Errors
+let CategoryName = "Root Signature Lexical Issue" in {
+ def err_hlsl_inval
https://github.com/llvm-beanz approved this pull request.
https://github.com/llvm/llvm-project/pull/126561
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
llvm-beanz wrote:
note to self: https://hlsl.godbolt.org/z/1Tq59r89W
https://github.com/llvm/llvm-project/pull/123141
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
llvm-beanz wrote:
> I think I already did this
> clang/test/SemaHLSL/Language/ElementwiseCast-errors.hlsl
Perfect! Sorry for missing that. LGTM
https://github.com/llvm/llvm-project/pull/118842
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
h
https://github.com/llvm-beanz approved this pull request.
One small request: can you add a test that verifies we produce an error if you
try to cast to or from a structure containing a bitfield?
https://github.com/llvm/llvm-project/pull/118842
___
cfe
https://github.com/llvm-beanz approved this pull request.
https://github.com/llvm/llvm-project/pull/126258
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/llvm-beanz updated
https://github.com/llvm/llvm-project/pull/123141
>From 8457635e366f791d03604384c232bc3d270ce0f8 Mon Sep 17 00:00:00 2001
From: Chris Bieneman
Date: Wed, 15 Jan 2025 13:40:29 -0600
Subject: [PATCH 1/2] [HLSL] Implement HLSL intialization list support
This P
https://github.com/llvm-beanz updated
https://github.com/llvm/llvm-project/pull/123141
>From 8457635e366f791d03604384c232bc3d270ce0f8 Mon Sep 17 00:00:00 2001
From: Chris Bieneman
Date: Wed, 15 Jan 2025 13:40:29 -0600
Subject: [PATCH 1/3] [HLSL] Implement HLSL intialization list support
This P
https://github.com/llvm-beanz updated
https://github.com/llvm/llvm-project/pull/123141
>From 8457635e366f791d03604384c232bc3d270ce0f8 Mon Sep 17 00:00:00 2001
From: Chris Bieneman
Date: Wed, 15 Jan 2025 13:40:29 -0600
Subject: [PATCH 1/4] [HLSL] Implement HLSL intialization list support
This P
@@ -0,0 +1,69 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute
-finclude-default-header -verify -Wdouble-promotion -Wconversion %s
+
+struct TwoFloats {
+ float X, Y;
+};
+
+struct TwoInts {
+ int Z, W;
+};
+
+struct Doggo {
+ int4 LegState;
+ int TailState;
+ f
https://github.com/llvm-beanz updated
https://github.com/llvm/llvm-project/pull/123141
>From a5d0d86b71ac7d7083295f255b42d991859a62f1 Mon Sep 17 00:00:00 2001
From: Chris Bieneman
Date: Wed, 15 Jan 2025 13:40:29 -0600
Subject: [PATCH 1/5] [HLSL] Implement HLSL intialization list support
This P
@@ -345,6 +345,14 @@ void clang::CodeGen::CGHLSLRuntime::setHLSLEntryAttributes(
WaveSizeAttr->getPreferred());
Fn->addFnAttr(WaveSizeKindStr, WaveSizeStr);
}
+ // HLSL entry functions are materialized for module functions with
+ // HLSLShaderAttr attrib
https://github.com/llvm-beanz edited
https://github.com/llvm/llvm-project/pull/125937
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/llvm-beanz approved this pull request.
One nit, otherwise LGTM.
https://github.com/llvm/llvm-project/pull/125937
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/llvm-beanz commented:
I have a couple concerns about this approach. I'm curious for @bogner's
thoughts since he has approved the PR.
1) If/when we support separate compilation, the user-facing exported "resource"
object will be the resource wrapper, not the handle, so that i
llvm-beanz wrote:
This seems like the wrong place to put this test. We don't need actual codegen
here, we just need to make sure it parses.
I'd put this under SemaHLSL and instead use a run line like:
```hlsl
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-l
@@ -1017,4 +1017,15 @@ Error<"'#pragma unsafe_buffer_usage' was not ended">;
def err_pp_pragma_unsafe_buffer_usage_syntax :
Error<"expected 'begin' or 'end'">;
+
+// HLSL Root Signature Lexing Errors
+let CategoryName = "Root Signature Lexical Issue" in {
+ def err_hlsl_expec
https://github.com/llvm-beanz commented:
In general I think this is very much moving in the right direction. I have two
high level areas of feedback (see my more specific comments inline).
In general, Lexer's don't often have the context to provide actionable error
messages. As a result it is
@@ -0,0 +1,194 @@
+#include "clang/Parse/ParseHLSLRootSignature.h"
+
+namespace clang {
+namespace hlsl {
+
+// Lexer Definitions
+
+static bool IsNumberChar(char C) {
+ // TODO(#126565): extend for float support exponents
+ return isdigit(C); // integer support
+}
+
+bool RootS
@@ -0,0 +1,194 @@
+#include "clang/Parse/ParseHLSLRootSignature.h"
+
+namespace clang {
+namespace hlsl {
+
+// Lexer Definitions
+
+static bool IsNumberChar(char C) {
+ // TODO(#126565): extend for float support exponents
+ return isdigit(C); // integer support
+}
+
+bool RootS
@@ -0,0 +1,194 @@
+#include "clang/Parse/ParseHLSLRootSignature.h"
+
+namespace clang {
+namespace hlsl {
+
+// Lexer Definitions
+
+static bool IsNumberChar(char C) {
+ // TODO(#126565): extend for float support exponents
+ return isdigit(C); // integer support
+}
+
+bool RootS
@@ -0,0 +1,171 @@
+#include "clang/Parse/ParseHLSLRootSignature.h"
+
+namespace clang {
+namespace hlsl {
+
+// Lexer Definitions
+
+static bool IsNumberChar(char C) {
+ // TODO(#120472): extend for float support exponents
+ return isdigit(C); // integer support
+}
+
+bool RootS
https://github.com/llvm-beanz edited
https://github.com/llvm/llvm-project/pull/122981
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -114,7 +114,7 @@ macro(add_clang_library name)
if(TARGET "obj.${name}")
target_compile_definitions("obj.${name}" PUBLIC CLANG_BUILD_STATIC)
endif()
- elseif(NOT ARG_SHARED AND NOT ARG_STATIC)
+ elseif(NOT ARG_SHARED AND NOT ARG_STATIC AND NOT ARG_CLANG_IMPORT
llvm-beanz wrote:
What is the case where an object library wouldn't need to act as
`CLANG_IMPORT`? It seems to me like the object library needs to be built
assuming that it is importing clang symbols unless it is one of the core clang
components.
https://github.com/llvm/llvm-project/pull/1123
https://github.com/llvm-beanz approved this pull request.
https://github.com/llvm/llvm-project/pull/117781
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
llvm-beanz wrote:
Is this the right solution, or should we be doing something to force the
constructor function to be generated. I'm a little worried that we have one
path for initializing some types of globals and a different approach for other
globals.
https://github.com/llvm/llvm-project/p
@@ -9272,6 +9272,8 @@ def err_typecheck_expect_scalar_or_vector : Error<
"a vector of such type is required">;
def err_typecheck_expect_any_scalar_or_vector : Error<
"invalid operand of type %0 where a scalar or vector is required">;
+def err_typecheck_expect_scalar_or_vect
https://github.com/llvm-beanz approved this pull request.
https://github.com/llvm/llvm-project/pull/119444
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
llvm-beanz wrote:
> any chance you could A/B test this on a bootstrap of clang, for instance? To
> help validate that this really is NFC/dead code?
I did a little more archeology, and I'm actually struggling to find any point
in the history where this change was required. The difference betwee
llvm-beanz wrote:
> You are correct @llvm-beanz, this change is not needed at all. Sorry for
> wasting your time!
Even a broken clock is right twice a day... me being the broken clock here 😄
It's never a waste to put something up to review if it helps us get to the
right solution.
https://gi
https://github.com/llvm-beanz approved this pull request.
https://github.com/llvm/llvm-project/pull/120466
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -208,37 +208,44 @@ Examples:
.. code-block:: llvm
- ; RWBuffer Buf : register(u5, space3)
- %buf = call target("dx.TypedBuffer", <4 x float>, 1, 0, 0)
- @llvm.dx.handle.fromBinding.tdx.TypedBuffer_f32_1_0(
- i32 3, i32 5, i32 1, i32 0, i
@@ -1754,6 +1755,17 @@ static bool interp__builtin_vector_reduce(InterpState
&S, CodePtr OpPC,
PrimType ElemT = *S.getContext().classify(ElemType);
unsigned NumElems = Arg.getNumElems();
+ if (ElemType->isRealFloatingType()) {
+if (ID != Builtin::BI__builtin_reduce_a
@@ -12338,7 +12338,8 @@ def err_builtin_invalid_arg_type: Error <
"a vector of integers|"
"an unsigned integer|"
"an 'int'|"
- "a vector of floating points}1 (was %2)">;
+ "a vector of floating points|"
+ "a vector of integers or floating points}1 (was %2)">;
-
llvm-beanz wrote:
With how `RUN` lines tend to get copied from test to test, I think it is
probably best to limit how many tests explicitly disable fast math otherwise
they're likely to proliferate across future tests.
https://github.com/llvm/llvm-project/pull/119820
__
@@ -3139,136 +3151,269 @@ Register
SPIRVInstructionSelector::buildPointerToResource(
return AcReg;
}
-bool SPIRVInstructionSelector::selectFirstBitHigh16(Register ResVReg,
-const SPIRVType *ResType,
-
@@ -3139,136 +3151,269 @@ Register
SPIRVInstructionSelector::buildPointerToResource(
return AcReg;
}
-bool SPIRVInstructionSelector::selectFirstBitHigh16(Register ResVReg,
-const SPIRVType *ResType,
-
@@ -3139,136 +3151,269 @@ Register
SPIRVInstructionSelector::buildPointerToResource(
return AcReg;
}
-bool SPIRVInstructionSelector::selectFirstBitHigh16(Register ResVReg,
-const SPIRVType *ResType,
-
@@ -3139,136 +3151,269 @@ Register
SPIRVInstructionSelector::buildPointerToResource(
return AcReg;
}
-bool SPIRVInstructionSelector::selectFirstBitHigh16(Register ResVReg,
-const SPIRVType *ResType,
-
@@ -1229,8 +1248,15 @@ FunctionPass *llvm::createSPIRVStructurizerPass() {
PreservedAnalyses SPIRVStructurizerWrapper::run(Function &F,
FunctionAnalysisManager &AF) {
- FunctionPass *StructurizerPass = createSPIRVStructurizerPas
@@ -0,0 +1,43 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-compute -ast-dump %s |
FileCheck %s
+
+// CHECK: FunctionDecl 0x{{[0-9A-Fa-f]+}} <{{.*}}> {{.*}} used branch 'int
(int)'
+// CHECK: AttributedStmt 0x{{[0-9A-Fa-f]+}} <
+// CHECK-NEXT: -HLSLControlFlowHintAttr 0x
@@ -0,0 +1,48 @@
+// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple
dxil-pc-shadermodel6.3-library %s -fnative-half-type -emit-llvm -o - |
FileCheck %s
+// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple
spirv-vulkan-library %s -fnative-half-type -emit-llvm -
https://github.com/llvm-beanz requested changes to this pull request.
Mostly minor nits, but the stuff in `SPIRVStructurizerWrapper::run` has to
change before we land this.
https://github.com/llvm/llvm-project/pull/116331
___
cfe-commits mailing list
@@ -2776,19 +2788,23 @@ bool SPIRVInstructionSelector::selectIntrinsic(Register
ResVReg,
}
return MIB.constrainAllUses(TII, TRI, RBI);
}
- case Intrinsic::spv_loop_merge:
- case Intrinsic::spv_selection_merge: {
-const auto Opcode = IID == Intrinsic::spv_select
https://github.com/llvm-beanz edited
https://github.com/llvm/llvm-project/pull/116331
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -295,6 +296,39 @@ static MDTuple *emitTopLevelLibraryNode(Module &M, MDNode
*RMD,
return constructEntryMetadata(nullptr, nullptr, RMD, Properties, Ctx);
}
+// TODO: We might need to refactor this to be more generic,
+// in case we need more metadata to be replaced.
+stat
@@ -2081,7 +2081,26 @@ void CodeGenFunction::EmitBranchOnBoolExpr(
Weights = createProfileWeights(TrueCount, CurrentCount - TrueCount);
}
- Builder.CreateCondBr(CondV, TrueBlock, FalseBlock, Weights, Unpredictable);
+ auto *BrInst = Builder.CreateCondBr(CondV, TrueBloc
@@ -9272,6 +9272,8 @@ def err_typecheck_expect_scalar_or_vector : Error<
"a vector of such type is required">;
def err_typecheck_expect_any_scalar_or_vector : Error<
"invalid operand of type %0 where a scalar or vector is required">;
+def err_typecheck_expect_scalar_or_vect
@@ -17,12 +17,10 @@ double test_int_builtin(double p0) {
double2 test_int_builtin_2(double2 p0) {
return __builtin_hlsl_elementwise_firstbithigh(p0);
- // expected-error@-1 {{1st argument must be a vector of integers
- // (was 'double2' (aka 'vector'))}}
+ // expected-err
llvm-beanz wrote:
Quick sanity check question for @bogner:
In DXC we apply the `fast` flag, which in LLVM 3.7 implies: `nnan ninf nsz
arcp` and includes the modern interpretation of `reassoc`
With this change we are applying: `reassoc nnan ninf nsz arcp afn` (no `fast`
because its meaning is
https://github.com/llvm-beanz requested changes to this pull request.
https://github.com/llvm/llvm-project/pull/119755
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -54,78 +54,108 @@ void addDxilValVersion(StringRef ValVersionStr,
llvm::Module &M) {
auto *DXILValMD = M.getOrInsertNamedMetadata(DXILValKey);
DXILValMD->addOperand(Val);
}
+
void addDisableOptimizations(llvm::Module &M) {
StringRef Key = "dx.disable_optimizations";
@@ -54,78 +54,108 @@ void addDxilValVersion(StringRef ValVersionStr,
llvm::Module &M) {
auto *DXILValMD = M.getOrInsertNamedMetadata(DXILValKey);
DXILValMD->addOperand(Val);
}
+
void addDisableOptimizations(llvm::Module &M) {
StringRef Key = "dx.disable_optimizations";
@@ -54,78 +54,108 @@ void addDxilValVersion(StringRef ValVersionStr,
llvm::Module &M) {
auto *DXILValMD = M.getOrInsertNamedMetadata(DXILValKey);
DXILValMD->addOperand(Val);
}
+
void addDisableOptimizations(llvm::Module &M) {
StringRef Key = "dx.disable_optimizations";
@@ -164,18 +164,18 @@ Decl *SemaHLSL::ActOnStartBuffer(Scope *BufferScope, bool
CBuffer,
return Result;
}
-// Calculate the size of a legacy cbuffer type based on
+// Calculate the size of a legacy cbuffer type in bytes based on
//
https://learn.microsoft.com/en-us/window
@@ -890,6 +890,10 @@ CodeGenModule::EmitCXXGlobalInitFunc() {
ModuleInits.push_back(Fn);
}
+ if (getLangOpts().HLSL && getHLSLRuntime().needsResourceBindingInitFn()) {
+CXXGlobalInits.push_back(getHLSLRuntime().createResourceBindingInitFn());
+ }
--
https://github.com/llvm-beanz approved this pull request.
This change looks right for DXIL (and I'll approve in that context), but
@s-perron's comment about SPIR-V is something we should address before merging.
https://github.com/llvm/llvm-project/pull/117303
___
https://github.com/llvm-beanz approved this pull request.
This approach makes sense to me.
https://github.com/llvm/llvm-project/pull/117303
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-comm
@@ -588,7 +588,7 @@ llvm::Function
*CGHLSLRuntime::createResourceBindingInitFn() {
auto *Slot = llvm::ConstantInt::get(CGM.IntTy, RBA->getSlotNumber());
// FIXME: resource arrays are not yet implemented
auto *Range = llvm::ConstantInt::get(CGM.IntTy, 1);
-
@@ -300,6 +301,36 @@ static MDTuple *emitTopLevelLibraryNode(Module &M, MDNode
*RMD,
return constructEntryMetadata(nullptr, nullptr, RMD, Properties, Ctx);
}
+// TODO: We might need to refactor this to be more generic,
+// in case we need more metadata to be replaced.
+stat
@@ -2694,19 +2694,41 @@ bool SPIRVInstructionSelector::selectIntrinsic(Register
ResVReg,
}
return MIB.constrainAllUses(TII, TRI, RBI);
}
- case Intrinsic::spv_loop_merge:
- case Intrinsic::spv_selection_merge: {
-const auto Opcode = IID == Intrinsic::spv_select
@@ -1206,6 +1202,20 @@ class SPIRVStructurizer : public FunctionPass {
AU.addPreserved();
FunctionPass::getAnalysisUsage(AU);
}
+
+ void createOpSelectMerge(IRBuilder<> *Builder, BlockAddress *MergeAddress) {
+Instruction *BBTerminatorInst = Builder->GetInsertBlo
@@ -784,6 +785,17 @@ void SemaHLSL::handleSV_DispatchThreadIDAttr(Decl *D,
const ParsedAttr &AL) {
HLSLSV_DispatchThreadIDAttr(getASTContext(), AL));
}
+void SemaHLSL::handleSV_GroupIDAttr(Decl *D, const ParsedAttr &AL) {
+ auto *VD = cast(D);
+ if (!isLega
@@ -784,6 +785,17 @@ void SemaHLSL::handleSV_DispatchThreadIDAttr(Decl *D,
const ParsedAttr &AL) {
HLSLSV_DispatchThreadIDAttr(getASTContext(), AL));
}
+void SemaHLSL::handleSV_GroupIDAttr(Decl *D, const ParsedAttr &AL) {
+ auto *VD = cast(D);
+ if (!isLega
https://github.com/llvm-beanz approved this pull request.
This looks great!
I know there was a lot of churn on this, but it came out really great. Thank
you!
https://github.com/llvm/llvm-project/pull/116413
___
cfe-commits mailing list
cfe-commits@li
@@ -5322,6 +5324,11 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo
&CallInfo,
IRCallArgs[FirstIRArg] = Val;
break;
}
+ } else if (I->getType()->isArrayParameterType()) {
+// use the tmp created by the HLSLOutArgExpr
+/
https://github.com/llvm-beanz commented:
I think this gets really complicated really quickly. The `a` prefix for
arguments seems like a coding style derived from Hungarian Notation, and I
guess I could see an argument for having an option to disregard variable
prefixes when matching the hints,
@@ -761,7 +762,37 @@ void StoreDiags::HandleDiagnostic(DiagnosticsEngine::Level
DiagLevel,
return false;
if (!isInsideMainFile(FixIt.RemoveRange.getBegin(), SM))
return false;
- Edits.push_back(toTextEdit(FixIt, SM, *LangOpts));
+
+ auto R = too
@@ -761,7 +762,37 @@ void StoreDiags::HandleDiagnostic(DiagnosticsEngine::Level
DiagLevel,
return false;
if (!isInsideMainFile(FixIt.RemoveRange.getBegin(), SM))
return false;
- Edits.push_back(toTextEdit(FixIt, SM, *LangOpts));
+
+ auto R = too
https://github.com/llvm-beanz edited
https://github.com/llvm/llvm-project/pull/118569
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -761,7 +762,37 @@ void StoreDiags::HandleDiagnostic(DiagnosticsEngine::Level
DiagLevel,
return false;
if (!isInsideMainFile(FixIt.RemoveRange.getBegin(), SM))
return false;
- Edits.push_back(toTextEdit(FixIt, SM, *LangOpts));
+
+ auto R = too
701 - 800 of 932 matches
Mail list logo