https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/136580
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/136234
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,7 @@
+// RUN: %if clang-dxc %{not %clang_dxc -T lib_6_3 %s 2>&1 | FileCheck %s %}
bogner wrote:
I don't think there's a `clang-dxc` feature, so I suspect this just never runs
at all. This will fail if the DirectX backend isn't available, so I don't th
@@ -756,9 +756,10 @@ class OpLowerer {
case Intrinsic::not_intrinsic:
continue;
default: {
-DiagnosticInfoUnsupported Diag(
-F, "Unsupported intrinsic for DXIL lowering");
-M.getContext().diagnose(Diag);
+std::string Msg =
@@ -139,7 +139,7 @@ class DiagnosticInfo {
using DiagnosticHandlerFunction = std::function;
class DiagnosticInfoGeneric : public DiagnosticInfo {
- const Twine &MsgStr;
+ const Twine MsgStr;
bogner wrote:
All of the Twine usage in Diagnostic info is super s
https://github.com/bogner approved this pull request.
The fact that we get memcpy here points out some of the issues we have with
representing cbuffers - it would really be nicer if this ended up generating
elementwise copies instead. However, I think fixing that is out of the scope of
this ch
bogner wrote:
This doesn't seem right. Are we just misusing `DiagnosticInfoUnsupported` here?
The `Function` argument for `DiagnosticInfoWithLocationBase` is clearly meant
to be part of the location (as evidenced by the "in function XYZ" part of the
message). I suspect that we should really be
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/133800
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bogner closed
https://github.com/llvm/llvm-project/pull/135909
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
bogner wrote:
I'm not entirely convinced the generic `ParsedParamState` is the right level of
abstraction. In some ways the declarative nature is nice, but I think it's
quite a bit more complex than a simple recursive descent here.
Warning - lots of untested and never compiled code follows. C
https://github.com/bogner closed
https://github.com/llvm/llvm-project/pull/135876
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
bogner wrote:
> As a general comment, your approach of just checking for the existence of the
> binding attribute may not in itself be sufficient. Consider this PR:
> https://github.com/llvm/llvm-project/pull/135287/files There is a potential
> case where the binding attribute has a slot = -1,
@@ -3278,6 +3284,9 @@ void SemaHLSL::processExplicitBindingsOnDecl(VarDecl *VD)
{
<< static_cast(RT);
}
}
+
+ if (!HasBinding && VD->getType()->isHLSLResourceRecord())
bogner wrote:
Good catch! Added some tests with arrays and updated this to
@@ -14,6 +14,12 @@ RWBuffer c;
// No warning - explicit binding.
RWBuffer d : register(u0);
+// No warning - explicit binding.
+RWBuffer dd : register(space1);
bogner wrote:
Yes, you're correct. I've updated the latest, though this is commented out now
becau
@@ -0,0 +1,28 @@
+// RUN: %clang_cc1 -Wno-error=hlsl-implicit-binding -triple
dxil-pc-shadermodel6.3-library -x hlsl -o - -fsyntax-only %s -verify
+
+// expected-warning@+1 {{resource has implicit register binding}}
+cbuffer cb0 {
+ int a;
+}
+
+// No warning - this is an elemen
https://github.com/bogner updated
https://github.com/llvm/llvm-project/pull/135909
>From cabe20bfd129a574f978c2a10e4f66a04cb85794 Mon Sep 17 00:00:00 2001
From: Justin Bogner
Date: Wed, 2 Apr 2025 11:34:00 -0700
Subject: [PATCH 1/6] [HLSL] Add a warning for implicit bindings
Implicit bindi
https://github.com/bogner updated
https://github.com/llvm/llvm-project/pull/135909
>From cabe20bfd129a574f978c2a10e4f66a04cb85794 Mon Sep 17 00:00:00 2001
From: Justin Bogner
Date: Wed, 2 Apr 2025 11:34:00 -0700
Subject: [PATCH 1/2] [HLSL] Add a warning for implicit bindings
Implicit bindi
@@ -3278,6 +3284,9 @@ void SemaHLSL::processExplicitBindingsOnDecl(VarDecl *VD)
{
<< static_cast(RT);
}
}
+
+ if (!HasBinding && VD->getType()->isHLSLResourceRecord())
+SemaRef.Diag(VD->getLocation(), diag::warn_hlsl_implicit_binding);
bog
https://github.com/bogner updated
https://github.com/llvm/llvm-project/pull/135876
>From de6d197193e758d649cbebe6d96cd8e5af95d9ac Mon Sep 17 00:00:00 2001
From: Justin Bogner
Date: Tue, 15 Apr 2025 15:05:21 -0700
Subject: [PATCH 1/2] [HLSL] Don't invoke `dxv` from `clang-dxc` for text
@@ -309,6 +309,9 @@ HLSLToolChain::TranslateArgs(const DerivedArgList &Args,
StringRef BoundArch,
}
bool HLSLToolChain::requiresValidation(DerivedArgList &Args) const {
+ if (!Args.hasArg(options::OPT_dxc_Fo))
+return false;
bogner wrote:
I'm not sure I
e sense to do so.
Fixes #135874.
>From de6d197193e758d649cbebe6d96cd8e5af95d9ac Mon Sep 17 00:00:00 2001
From: Justin Bogner
Date: Tue, 15 Apr 2025 15:05:21 -0700
Subject: [PATCH] [HLSL] Don't invoke `dxv` from `clang-dxc` for text output
Running `clang-dxc` with textual output wa
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/135830
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -11360,6 +11360,14 @@ static void AnalyzeAssignment(Sema &S, BinaryOperator
*E) {
static void DiagnoseImpCast(Sema &S, Expr *E, QualType SourceType, QualType T,
SourceLocation CContext, unsigned diag,
bool pruneControl
https://github.com/bogner closed
https://github.com/llvm/llvm-project/pull/134570
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bogner closed
https://github.com/llvm/llvm-project/pull/133287
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
rom 7f8833f723d4a7d4d69160765477ee646fba1083 Mon Sep 17 00:00:00 2001
From: Justin Bogner
Date: Wed, 2 Apr 2025 15:21:21 -0700
Subject: [PATCH] [DirectX] Use scalar arguments for @llvm.dx.dot intrinsics
The `dx.dot2`, `dot3`, and `dot4` intrinsics exist purely to lower
`dx.fdot`, and they map exactly to the D
@@ -21,20 +21,15 @@ class NamespaceDecl;
class Sema;
class HLSLExternalSemaSource : public ExternalSemaSource {
+private:
bogner wrote:
The default visibility in `class` is private, so this doesn't do anything
https://github.com/llvm/llvm-project/pull/131032
https://github.com/bogner updated
https://github.com/llvm/llvm-project/pull/130231
>From bf5e5b4b1060f51d37b05c905b4327a40316f158 Mon Sep 17 00:00:00 2001
From: Justin Bogner
Date: Thu, 6 Mar 2025 17:50:12 -0800
Subject: [PATCH 1/3] [HLSL] Buffer handle globals should not be constants
https://github.com/bogner approved this pull request.
This looks sensible to me.
https://github.com/llvm/llvm-project/pull/133619
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bogner updated
https://github.com/llvm/llvm-project/pull/130231
>From bf5e5b4b1060f51d37b05c905b4327a40316f158 Mon Sep 17 00:00:00 2001
From: Justin Bogner
Date: Thu, 6 Mar 2025 17:50:12 -0800
Subject: [PATCH 1/2] [HLSL] Buffer handle globals should not be constants
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/133302
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/132967
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/131942
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/132828
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,110 @@
+//===--- ParseHLSLRootSignature.h ---*- C++
-*-===//
+//
+// 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,188 @@
+#include "clang/Parse/ParseHLSLRootSignature.h"
+
+#include "llvm/Support/raw_ostream.h"
+
+using namespace llvm::hlsl::rootsig;
+
+namespace clang {
+namespace hlsl {
+
+static std::string FormatTokenKinds(ArrayRef Kinds) {
bogner wrote:
You c
@@ -0,0 +1,188 @@
+#include "clang/Parse/ParseHLSLRootSignature.h"
+
+#include "llvm/Support/raw_ostream.h"
+
+using namespace llvm::hlsl::rootsig;
+
+namespace clang {
+namespace hlsl {
+
+static std::string FormatTokenKinds(ArrayRef Kinds) {
+ std::string TokenString;
+ llvm::
@@ -0,0 +1,188 @@
+#include "clang/Parse/ParseHLSLRootSignature.h"
+
+#include "llvm/Support/raw_ostream.h"
+
+using namespace llvm::hlsl::rootsig;
+
+namespace clang {
+namespace hlsl {
+
+static std::string FormatTokenKinds(ArrayRef Kinds) {
+ std::string TokenString;
+ llvm::
@@ -0,0 +1,110 @@
+//===--- ParseHLSLRootSignature.h ---*- C++
-*-===//
+//
+// 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,110 @@
+//===--- ParseHLSLRootSignature.h ---*- C++
-*-===//
+//
+// 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,188 @@
+#include "clang/Parse/ParseHLSLRootSignature.h"
+
+#include "llvm/Support/raw_ostream.h"
+
+using namespace llvm::hlsl::rootsig;
+
+namespace clang {
+namespace hlsl {
+
+static std::string FormatTokenKinds(ArrayRef Kinds) {
+ std::string TokenString;
+ llvm::
https://github.com/bogner edited
https://github.com/llvm/llvm-project/pull/133302
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bogner commented:
One comment saying you should rename all of the methods in this patch and a few
small suggestions, but this is looking pretty close
https://github.com/llvm/llvm-project/pull/133302
___
cfe-commits mailing list
cfe-
@@ -1,13 +1,10 @@
# Including the native target is important because some of LLVM's tests fail if
# you don't.
-set(LLVM_TARGETS_TO_BUILD Native CACHE STRING "")
+set(LLVM_TARGETS_TO_BUILD "Native;SPIRV" CACHE STRING "")
-# Include the DirectX target for DXIL code generation,
https://github.com/bogner created
https://github.com/llvm/llvm-project/pull/133287
Since SPIRV is no longer an experimental target this wasn't actually enabling
it any more.
>From 5c4b19d99275440eef8a360f5d8f1affd7869e0e Mon Sep 17 00:00:00 2001
From: Justin Bogner
Date: Thu, 27 Mar
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/131032
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bogner updated
https://github.com/llvm/llvm-project/pull/130231
>From bf5e5b4b1060f51d37b05c905b4327a40316f158 Mon Sep 17 00:00:00 2001
From: Justin Bogner
Date: Thu, 6 Mar 2025 17:50:12 -0800
Subject: [PATCH] [HLSL] Buffer handle globals should not be constants
If th
https://github.com/bogner closed
https://github.com/llvm/llvm-project/pull/130231
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bogner updated
https://github.com/llvm/llvm-project/pull/130231
>From bf5e5b4b1060f51d37b05c905b4327a40316f158 Mon Sep 17 00:00:00 2001
From: Justin Bogner
Date: Thu, 6 Mar 2025 17:50:12 -0800
Subject: [PATCH 1/4] [HLSL] Buffer handle globals should not be constants
https://github.com/bogner approved this pull request.
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/bogner approved this pull request.
One issue with inaccurate comments but otherwise LGTM!
https://github.com/llvm/llvm-project/pull/130222
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman
@@ -45,6 +45,10 @@ template struct is_arithmetic {
static const bool Value = __is_arithmetic(T);
};
+template
+using HLSL_FIXED_VECTOR =
bogner wrote:
`HLSL_FIXED_VECTOR` looks like a macro to me rather than a type. Why use all
caps convention here?
htt
https://github.com/bogner approved this pull request.
Looks good to me. One suggestion for an alternative approach (using `= delete`
on some overloads) but you can use your judgement on whether that's worth
trying.
https://github.com/llvm/llvm-project/pull/130724
__
@@ -89,23 +89,31 @@ void asuint(double4, out uint4, out uint4);
/// \param X The X input value.
/// \param Y The Y input value.
+template
_HLSL_16BIT_AVAILABILITY(shadermodel, 6.2)
-const inline half distance(half X, half Y) {
+const inline __detail::enable_if_t<__detail::is
https://github.com/bogner edited
https://github.com/llvm/llvm-project/pull/130724
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -89,23 +89,31 @@ void asuint(double4, out uint4, out uint4);
/// \param X The X input value.
/// \param Y The Y input value.
+template
_HLSL_16BIT_AVAILABILITY(shadermodel, 6.2)
-const inline half distance(half X, half Y) {
+const inline __detail::enable_if_t<__detail::is
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/130436
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,80 @@
+; RUN: opt -S -dxil-translate-metadata < %s | FileCheck %s
+; RUN: opt -S --passes="dxil-pretty-printer" < %s 2>&1 | FileCheck %s
--check-prefix=PRINT
+; RUN: llc %s --filetype=asm -o - < %s 2>&1 | FileCheck %s
--check-prefixes=CHECK,PRINT
+
+target datalayout
001
From: Justin Bogner
Date: Thu, 6 Mar 2025 17:50:12 -0800
Subject: [PATCH] [HLSL] Buffer handle globals should not be constants
If these are constants their initializers will be removed by
InstCombine. Change them to not be constants and initialize them with
poison.
---
clang/lib/Code
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/130223
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bogner edited
https://github.com/llvm/llvm-project/pull/130222
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,103 @@
+; RUN: opt -S -dxil-translate-metadata < %s | FileCheck %s
+; RUN: opt -S --passes="dxil-pretty-printer" < %s 2>&1 | FileCheck %s
--check-prefix=PRINT
+; RUN: llc %s --filetype=asm -o - < %s 2>&1 | FileCheck %s
--check-prefixes=CHECK,PRINT
+
+target datalayout
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/130173
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/127137
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -738,6 +739,16 @@ def UMin : DXILOp<40, binary> {
let attributes = [Attributes];
}
+def UAddc : DXILOp<44, binaryWithCarryOrBorrow > {
+ let Doc = "Unsigned 32-bit integer arithmetic add with carry. uaddc(a,b) =
(a+b, a+b overflowed ? 1 : 0)";
bogner wr
@@ -738,6 +739,16 @@ def UMin : DXILOp<40, binary> {
let attributes = [Attributes];
}
+def UAddc : DXILOp<44, binaryWithCarryOrBorrow > {
+ let Doc = "Unsigned 32-bit integer arithmetic add with carry. uaddc(a,b) =
(a+b, a+b overflowed ? 1 : 0)";
+ let intrinsics = [Intri
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/128894
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,72 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
UTC_ARGS: --version 5
+; RUN: opt -S -scalarizer -dxil-op-lower
-mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s
+
+; CHECK: %dx.types.i32c = type { i32, i1 }
+
+define noundef i
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/128589
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/128250
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
bogner wrote:
We can simplify the op lowering part a bit if we do #128247 first.
https://github.com/llvm/llvm-project/pull/127137
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bogner edited
https://github.com/llvm/llvm-project/pull/125599
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bogner approved this pull request.
I have some misgivings about the way we're partially introducing the error
handling here, but my disagreements are largely philosophical and procedural.
Since we've worked around the issues with the hwasan bot at this point it's
probably fi
@@ -905,6 +903,14 @@ bool SPIRVInstructionSelector::selectExtInst(Register
ResVReg,
const SPIRVType *ResType,
MachineInstr &I,
GL::GLSLExtInst
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/124886
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -905,6 +903,14 @@ bool SPIRVInstructionSelector::selectExtInst(Register
ResVReg,
const SPIRVType *ResType,
MachineInstr &I,
GL::GLSLExtInst
@@ -19445,6 +19445,70 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned
BuiltinID,
return nullptr;
switch (BuiltinID) {
+ case Builtin::BI__builtin_hlsl_adduint64: {
+Value *OpA = EmitScalarExpr(E->getArg(0));
+Value *OpB = EmitScalarExpr(E->getArg(1));
+
@@ -19445,6 +19445,70 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned
BuiltinID,
return nullptr;
switch (BuiltinID) {
+ case Builtin::BI__builtin_hlsl_adduint64: {
+Value *OpA = EmitScalarExpr(E->getArg(0));
+Value *OpB = EmitScalarExpr(E->getArg(1));
+
@@ -249,6 +249,23 @@ bool all(double3);
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_all)
bool all(double4);
+//===--===//
+// and builtins
+//===--===
https://github.com/bogner closed
https://github.com/llvm/llvm-project/pull/127098
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
bogner wrote:
LGTM - I've gone ahead and merged this for you. Thanks!
https://github.com/llvm/llvm-project/pull/127098
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -249,6 +249,23 @@ bool all(double3);
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_all)
bool all(double4);
+//===--===//
+// and builtins
+//===--===
@@ -249,6 +249,23 @@ bool all(double3);
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_all)
bool all(double4);
+//===--===//
+// and builtins
+//===--===
@@ -115,48 +83,176 @@ llvm::Triple::ArchType CGHLSLRuntime::getArch() {
return CGM.getTarget().getTriple().getArch();
}
-void CGHLSLRuntime::addConstant(VarDecl *D, Buffer &CB) {
- if (D->getStorageClass() == SC_Static) {
-// For static inside cbuffer, take as global st
@@ -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,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
@@ -115,48 +83,176 @@ llvm::Triple::ArchType CGHLSLRuntime::getArch() {
return CGM.getTarget().getTriple().getArch();
}
-void CGHLSLRuntime::addConstant(VarDecl *D, Buffer &CB) {
- if (D->getStorageClass() == SC_Static) {
-// For static inside cbuffer, take as global st
@@ -115,48 +83,176 @@ llvm::Triple::ArchType CGHLSLRuntime::getArch() {
return CGM.getTarget().getTriple().getArch();
}
-void CGHLSLRuntime::addConstant(VarDecl *D, Buffer &CB) {
- if (D->getStorageClass() == SC_Static) {
-// For static inside cbuffer, take as global st
@@ -115,48 +83,176 @@ llvm::Triple::ArchType CGHLSLRuntime::getArch() {
return CGM.getTarget().getTriple().getArch();
}
-void CGHLSLRuntime::addConstant(VarDecl *D, Buffer &CB) {
- if (D->getStorageClass() == SC_Static) {
-// For static inside cbuffer, take as global st
@@ -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");
@@ -115,48 +83,176 @@ llvm::Triple::ArchType CGHLSLRuntime::getArch() {
return CGM.getTarget().getTriple().getArch();
}
-void CGHLSLRuntime::addConstant(VarDecl *D, Buffer &CB) {
- if (D->getStorageClass() == SC_Static) {
-// For static inside cbuffer, take as global st
@@ -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
https://github.com/bogner commented:
This is looking pretty good, though I have some misgivings about
`CommonHLSLTargetCodeGenInfo` and think it might be better to introduce a
`HLSLLayoutBuilder` that can be used by targets as necessary instead. If you
take that suggestion a couple of my comme
https://github.com/bogner edited
https://github.com/llvm/llvm-project/pull/124886
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-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
@@ -2927,6 +2898,53 @@ void CastOperation::CheckCXXCStyleCast(bool
FunctionalStyle,
}
}
+// CheckHLSLCStyleCast - Returns `true` ihe cast is handled or errored as an
+// HLSL-specific cast. Returns false if the cast should be checked as a CXX
+// C-Style cast.
+bool CastOpe
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/127557
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -94,6 +94,11 @@ bool Qualifiers::isTargetAddressSpaceSupersetOf(LangAS A,
LangAS B,
(A == LangAS::Default &&
(B == LangAS::cuda_constant || B == LangAS::cuda_device ||
B == LangAS::cuda_shared)) ||
+ // In HLSL, the this pointer for mem
@@ -94,6 +94,11 @@ bool Qualifiers::isTargetAddressSpaceSupersetOf(LangAS A,
LangAS B,
(A == LangAS::Default &&
(B == LangAS::cuda_constant || B == LangAS::cuda_device ||
B == LangAS::cuda_shared)) ||
+ // In HLSL, the this pointer for mem
https://github.com/bogner edited
https://github.com/llvm/llvm-project/pull/127675
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
1 - 100 of 965 matches
Mail list logo