@@ -799,6 +799,19 @@ static bool
IsEquivalentExceptionSpec(StructuralEquivalenceContext &Context,
return true;
}
+// Determine structural equivalence of two instances of
+// HLSLAttributedResourceType::Attributes
+static bool
+IsStructurallyEquivalent(StructuralEquivalenceC
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/106181
>From 11a6b3aac44889d39911a6704a9a963f29e92388 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Mon, 26 Aug 2024 12:13:09 -0700
Subject: [PATCH 1/7] Add HLSLAttributedResourceType - WIP
---
clang/include/clang
@@ -799,6 +799,19 @@ static bool
IsEquivalentExceptionSpec(StructuralEquivalenceContext &Context,
return true;
}
+// Determine structural equivalence of two instances of
+// HLSLAttributedResourceType::Attributes
+static bool
+IsStructurallyEquivalent(StructuralEquivalenceC
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/106181
>From 11a6b3aac44889d39911a6704a9a963f29e92388 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Mon, 26 Aug 2024 12:13:09 -0700
Subject: [PATCH 1/8] Add HLSLAttributedResourceType - WIP
---
clang/include/clang
https://github.com/hekota created
https://github.com/llvm/llvm-project/pull/106657
Adjust register binding diagnostic flags code in a couple of ways:
- Store the resource class in the Flags struct to avoid duplicated scanning for
HLSLResourceClassAttribute
- Avoid unnecessary indirection when c
https://github.com/hekota closed
https://github.com/llvm/llvm-project/pull/106181
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota created
https://github.com/llvm/llvm-project/pull/106673
Implements `TreeTransform::TransformHLSLAttributedResourceType` which
will enable use of attributed resource types inside templates.
Follow up from llvm/llvm-project#106181
Related to llvm/llvm-project#104861
hekota wrote:
> Tests?
There are tests yet because the code that creates HLSLAttributedResourceType is
not in yet. There will be tests for this included in the PR that switches
resource attributes to be on types. I understand this is not ideal. I am just
trying to reduce the size of that PR b
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/106673
>From f060654648707f3bf7ecf68b01db8d7c0a8b2bf6 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Thu, 29 Aug 2024 23:51:54 -0700
Subject: [PATCH 1/2] [HLSL] Implement TransformHLSLAttributedResourceType to
enabl
@@ -612,57 +588,61 @@ static RegisterBindingFlags
HLSLFillRegisterBindingFlags(Sema &S,
return Flags;
}
- if (!isDeclaredWithinCOrTBuffer(TheDecl)) {
-// make sure the type is a basic / numeric type
-if (TheVarDecl) {
- QualType TheQualTy = TheVarDecl->get
@@ -480,6 +480,9 @@ struct RegisterBindingFlags {
bool ContainsNumeric = false;
bool DefaultGlobals = false;
+
+ // used only when Resource == true
+ llvm::dxil::ResourceClass ResourceClass = llvm::dxil::ResourceClass::UAV;
hekota wrote:
Yes, the indivi
hekota wrote:
> Is there some other way to slice this so that there's a smaller part of your
> larger change that can actually be tested?
The thing is that we are already using resource attributes in many places, and
they all need to be updated when we switch to having the attributes on types
https://github.com/hekota closed
https://github.com/llvm/llvm-project/pull/106673
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/106657
>From 214f801923d654f5fcc96241840aa7742cd0e85b Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Thu, 29 Aug 2024 20:32:02 -0700
Subject: [PATCH 1/2] Improve code that fills resource binding flags
---
clang/lib
@@ -612,57 +588,61 @@ static RegisterBindingFlags
HLSLFillRegisterBindingFlags(Sema &S,
return Flags;
}
- if (!isDeclaredWithinCOrTBuffer(TheDecl)) {
-// make sure the type is a basic / numeric type
-if (TheVarDecl) {
- QualType TheQualTy = TheVarDecl->get
@@ -612,57 +588,61 @@ static RegisterBindingFlags
HLSLFillRegisterBindingFlags(Sema &S,
return Flags;
}
- if (!isDeclaredWithinCOrTBuffer(TheDecl)) {
-// make sure the type is a basic / numeric type
-if (TheVarDecl) {
- QualType TheQualTy = TheVarDecl->get
https://github.com/hekota closed https://github.com/llvm/llvm-project/pull/97370
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/89809
>From 22b67d30ca087d6a912183039c87fd1790eedfe4 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Tue, 23 Apr 2024 00:49:28 -0700
Subject: [PATCH 1/4] Add environment parameter to clang availability attribute
---
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/89809
>From 22b67d30ca087d6a912183039c87fd1790eedfe4 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Tue, 23 Apr 2024 00:49:28 -0700
Subject: [PATCH 1/5] Add environment parameter to clang availability attribute
---
@@ -3859,7 +3862,7 @@ def warn_availability_fuchsia_unavailable_minor : Warning<
InGroup;
def warn_unguarded_availability :
- Warning<"%0 is only available on %1 %2 or newer">,
+ Warning<"%0 %select{is only|is not}5 available %select{|in %4 environment
}3on %1 %2 %select{
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/89809
>From 22b67d30ca087d6a912183039c87fd1790eedfe4 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Tue, 23 Apr 2024 00:49:28 -0700
Subject: [PATCH 1/6] Add environment parameter to clang availability attribute
---
hekota wrote:
Ping
https://github.com/llvm/llvm-project/pull/89809
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/89809
>From 22b67d30ca087d6a912183039c87fd1790eedfe4 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Tue, 23 Apr 2024 00:49:28 -0700
Subject: [PATCH 1/7] Add environment parameter to clang availability attribute
---
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/89809
>From 22b67d30ca087d6a912183039c87fd1790eedfe4 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Tue, 23 Apr 2024 00:49:28 -0700
Subject: [PATCH 1/7] Add environment parameter to clang availability attribute
---
https://github.com/hekota created
https://github.com/llvm/llvm-project/pull/91699
None
>From 6220a5f61f92c3161772fd7c2be9d387169f8e03 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Thu, 9 May 2024 22:14:05 -0700
Subject: [PATCH] Enable unguarded availability diagnostic on instantiated
temp
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/91699
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota ready_for_review
https://github.com/llvm/llvm-project/pull/91699
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -177,16 +177,19 @@ void justAtAvailable(void) {
#ifdef OBJCPP
-int f(char) AVAILABLE_10_12;
+int f(char) AVAILABLE_10_12; // #f_char_def
int f(int);
template int use_f() {
- // FIXME: We should warn here!
- return f(T());
+ // expected-warning@#f_call {{'f' is only
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/91699
>From 6220a5f61f92c3161772fd7c2be9d387169f8e03 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Thu, 9 May 2024 22:14:05 -0700
Subject: [PATCH 1/2] Enable unguarded availability diagnostic on instantiated
templa
@@ -177,16 +177,19 @@ void justAtAvailable(void) {
#ifdef OBJCPP
-int f(char) AVAILABLE_10_12;
+int f(char) AVAILABLE_10_12; // #f_char_def
int f(int);
template int use_f() {
- // FIXME: We should warn here!
- return f(T());
hekota wrote:
Thanks for t
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/89809
>From 22b67d30ca087d6a912183039c87fd1790eedfe4 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Tue, 23 Apr 2024 00:49:28 -0700
Subject: [PATCH 1/7] Add environment parameter to clang availability attribute
---
@@ -18,14 +18,21 @@ namespace hlsl {
#define _HLSL_BUILTIN_ALIAS(builtin)
\
__attribute__((clang_builtin_alias(builtin)))
-#define _HLSL_AVAILABILITY(environment, version)
\
- __attribute__((availabil
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/89809
>From 22b67d30ca087d6a912183039c87fd1790eedfe4 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Tue, 23 Apr 2024 00:49:28 -0700
Subject: [PATCH 1/8] Add environment parameter to clang availability attribute
---
@@ -18,14 +18,21 @@ namespace hlsl {
#define _HLSL_BUILTIN_ALIAS(builtin)
\
__attribute__((clang_builtin_alias(builtin)))
-#define _HLSL_AVAILABILITY(environment, version)
\
- __attribute__((availabil
@@ -0,0 +1,140 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel5.0-compute -fsyntax-only
-verify %s
hekota wrote:
Done.
https://github.com/llvm/llvm-project/pull/89809
___
cfe-commits mailing list
cfe-commits@lists.
https://github.com/hekota created
https://github.com/llvm/llvm-project/pull/92207
None
>From 3df0ba0fd2171a0115427bc6ba5e3f8e84831747 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Tue, 14 May 2024 19:06:59 -0700
Subject: [PATCH 1/2] HLSL Availability Diagnostics Design Document - initial
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/92207
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,53 @@
+=
+HLSL Availability Diagnostics
+=
+
+.. contents::
+ :local:
+
+Introduction
+
+
+HLSL availability diagnostics emits errors or warning when unavailable shader
APIs are used. Unavailable sha
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/92207
>From 3df0ba0fd2171a0115427bc6ba5e3f8e84831747 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Tue, 14 May 2024 19:06:59 -0700
Subject: [PATCH 1/3] HLSL Availability Diagnostics Design Document - initial
commit
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/89809
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/92207
>From 3df0ba0fd2171a0115427bc6ba5e3f8e84831747 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Tue, 14 May 2024 19:06:59 -0700
Subject: [PATCH 1/4] HLSL Availability Diagnostics Design Document - initial
commit
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/92207
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/92207
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/92207
>From 3df0ba0fd2171a0115427bc6ba5e3f8e84831747 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Tue, 14 May 2024 19:06:59 -0700
Subject: [PATCH 1/5] HLSL Availability Diagnostics Design Document - initial
commit
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/92207
>From 3df0ba0fd2171a0115427bc6ba5e3f8e84831747 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Tue, 14 May 2024 19:06:59 -0700
Subject: [PATCH 1/6] HLSL Availability Diagnostics Design Document - initial
commit
@@ -0,0 +1,53 @@
+=
+HLSL Availability Diagnostics
+=
+
+.. contents::
+ :local:
+
+Introduction
+
+
+HLSL availability diagnostics emits errors or warning when unavailable shader
APIs are used. Unavailable sha
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/92207
>From 3df0ba0fd2171a0115427bc6ba5e3f8e84831747 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Tue, 14 May 2024 19:06:59 -0700
Subject: [PATCH 1/7] HLSL Availability Diagnostics Design Document - initial
commit
hekota wrote:
Right, and I am adding a lot more HLSL-specific tests in my upcoming PRs that
implement the diagnostic modes under the SemaHLSL directory. There is a number
of platform-specific tests for the availability attribute already here under
Sema though
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/92207
>From 3df0ba0fd2171a0115427bc6ba5e3f8e84831747 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Tue, 14 May 2024 19:06:59 -0700
Subject: [PATCH 1/8] HLSL Availability Diagnostics Design Document - initial
commit
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/92207
>From 3df0ba0fd2171a0115427bc6ba5e3f8e84831747 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Tue, 14 May 2024 19:06:59 -0700
Subject: [PATCH 1/8] HLSL Availability Diagnostics Design Document - initial
commit
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/92207
>From 3df0ba0fd2171a0115427bc6ba5e3f8e84831747 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Tue, 14 May 2024 19:06:59 -0700
Subject: [PATCH 1/9] HLSL Availability Diagnostics Design Document - initial
commit
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/92207
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota closed https://github.com/llvm/llvm-project/pull/92207
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota closed https://github.com/llvm/llvm-project/pull/89809
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota created
https://github.com/llvm/llvm-project/pull/92704
None
>From 433b8e142d05a8fe2206ae0cec62423b21e792d2 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Sun, 19 May 2024 11:10:38 -0700
Subject: [PATCH] HLSL Default and Relaxed Availability Diagnostics (#3)
---
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/92703
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota closed https://github.com/llvm/llvm-project/pull/92703
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/92704
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/92704
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/92704
>From 433b8e142d05a8fe2206ae0cec62423b21e792d2 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Sun, 19 May 2024 11:10:38 -0700
Subject: [PATCH 1/2] HLSL Default and Relaxed Availability Diagnostics (#3)
---
cl
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/92704
>From 433b8e142d05a8fe2206ae0cec62423b21e792d2 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Sun, 19 May 2024 11:10:38 -0700
Subject: [PATCH 1/3] HLSL Default and Relaxed Availability Diagnostics (#3)
---
cl
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/92704
>From 433b8e142d05a8fe2206ae0cec62423b21e792d2 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Sun, 19 May 2024 11:10:38 -0700
Subject: [PATCH 1/4] HLSL Default and Relaxed Availability Diagnostics (#3)
---
cl
https://github.com/hekota ready_for_review
https://github.com/llvm/llvm-project/pull/92704
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/92704
>From 433b8e142d05a8fe2206ae0cec62423b21e792d2 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Sun, 19 May 2024 11:10:38 -0700
Subject: [PATCH 1/5] HLSL Default and Relaxed Availability Diagnostics (#3)
---
cl
https://github.com/hekota approved this pull request.
LGTM!
https://github.com/llvm/llvm-project/pull/92793
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -290,3 +294,295 @@ void SemaHLSL::DiagnoseAttrStageMismatch(
<< A << HLSLShaderAttr::ConvertShaderTypeToStr(Stage)
<< (AllowedStages.size() != 1) << join(StageStrings, ", ");
}
+
+namespace {
+
+/// This class implements HLSL availability diagnostics for default
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/92704
>From 433b8e142d05a8fe2206ae0cec62423b21e792d2 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Sun, 19 May 2024 11:10:38 -0700
Subject: [PATCH 1/6] HLSL Default and Relaxed Availability Diagnostics (#3)
---
cl
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/92704
>From 433b8e142d05a8fe2206ae0cec62423b21e792d2 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Sun, 19 May 2024 11:10:38 -0700
Subject: [PATCH 1/6] HLSL Default and Relaxed Availability Diagnostics (#3)
---
cl
hekota wrote:
Thanks Chris!
https://github.com/llvm/llvm-project/pull/91699
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota closed https://github.com/llvm/llvm-project/pull/91699
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1081,6 +1088,12 @@ static llvm::Triple::EnvironmentType
getEnvironmentType(llvm::StringRef Environm
.Case("hull", llvm::Triple::Hull)
.Case("domain", llvm::Triple::Domain)
.Case("compute", llvm::Triple::Compute)
+ .Case("r
@@ -290,3 +294,295 @@ void SemaHLSL::DiagnoseAttrStageMismatch(
<< A << HLSLShaderAttr::ConvertShaderTypeToStr(Stage)
<< (AllowedStages.size() != 1) << join(StageStrings, ", ");
}
+
+namespace {
+
+/// This class implements HLSL availability diagnostics for default
@@ -0,0 +1,108 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library \
+// RUN: -fsyntax-only -Wno-error=hlsl-availability -verify %s
+
+__attribute__((availability(shadermodel, introduced = 6.5)))
+float fx(float); // #fx
+
+__attribute__((availability(shadermodel, intro
@@ -0,0 +1,98 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute \
+// RUN: -fsyntax-only -verify %s
+
+__attribute__((availability(shadermodel, introduced = 6.5)))
+float fx(float); // #fx
+
+__attribute__((availability(shadermodel, introduced = 5.0, environment =
pi
@@ -0,0 +1,108 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library \
+// RUN: -fsyntax-only -Wno-error=hlsl-availability -verify %s
+
+__attribute__((availability(shadermodel, introduced = 6.5)))
+float fx(float); // #fx
+
+__attribute__((availability(shadermodel, intro
@@ -1390,7 +1390,8 @@ void ASTContext::InitBuiltinTypes(const TargetInfo
&Target,
#include "clang/Basic/HLSLIntangibleTypes.def"
}
- if (Target.hasAArch64SVETypes()) {
+ if (Target.hasAArch64SVETypes() ||
hekota wrote:
I don't see this change in this PR
@@ -23,7 +23,7 @@ export module b;
import a;
export int b();
-// CHECK: https://github.com/llvm/llvm-project/pull/97362
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi
@@ -115,6 +116,18 @@ GlobalVariable *replaceBuffer(CGHLSLRuntime::Buffer &Buf) {
} // namespace
+llvm::Type *CGHLSLRuntime::convertHLSLSpecificType(const Type *T) {
+ assert(T->isHLSLSpecificType() && "Not an HLSL specific type!");
+
+ // Check if the target has a specific
hekota wrote:
> > I also don't see anywhere that actually successfully uses
> > `__builtin_hlsl_resource_t`. Am I missing it, or should I not expect to see
> > it?
>
> You are correct - the type cannot be directly declared in user code, so the
> tests only check for errors and that the type s
https://github.com/hekota ready_for_review
https://github.com/llvm/llvm-project/pull/95331
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
hekota wrote:
> Linking functions as internal should mean that they won't be included in the
> final output if they don't have any calls. A test that verifies that behavior
> would be useful.
>
> Even if they are called, a test that verifies that they have the "internal"
> attribute applied w
@@ -1,5 +1,8 @@
// RUN: %clang_cc1 -triple dxil-unknown-shadermodel6.6-library -S
-fnative-half-type -finclude-default-header -o - -ast-dump %s | FileCheck %s
// RUN: %clang_cc1 -finclude-default-header -triple
dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm
-
@@ -967,6 +967,10 @@ static void checkUndefinedButUsed(Sema &S) {
Func->getIdentifier()->isMangledOpenMPVariantName();
}
}
+ // Do not warn on undefined internal functions in HLSL, they will get
hekota wrote:
Good
@@ -119,3 +119,16 @@ behavior between Clang and DXC. Some examples include:
diagnostic notifying the user of the conversion rather than silently altering
precision relative to the other overloads (as FXC does) or generating code
that will fail validation (as DXC does).
+
@@ -158,7 +158,8 @@ def FunctionTmpl
def HLSLEntry
: SubsetSubjectisExternallyVisible() && !isa(S)}],
+ [{S->getDeclContext()->getRedeclContext()->isFileContext()
&&
+S->getStorageClass() != SC_Static}],
hekota wrote:
@@ -119,3 +119,16 @@ behavior between Clang and DXC. Some examples include:
diagnostic notifying the user of the conversion rather than silently altering
precision relative to the other overloads (as FXC does) or generating code
that will fail validation (as DXC does).
+
@@ -119,3 +119,49 @@ behavior between Clang and DXC. Some examples include:
diagnostic notifying the user of the conversion rather than silently altering
precision relative to the other overloads (as FXC does) or generating code
that will fail validation (as DXC does).
+
@@ -353,6 +353,23 @@ llvm::Value *CGHLSLRuntime::emitInputSemantic(IRBuilder<>
&B,
return nullptr;
}
+void CGHLSLRuntime::emitFunctionProlog(const FunctionDecl *FD,
+ llvm::Function *Fn) {
+ if (!FD || !Fn)
+return;
+
+ if (FD->ha
@@ -664,11 +664,25 @@ LinkageComputer::getLVForNamespaceScopeDecl(const
NamedDecl *D,
if (PrevVar->getStorageClass() == SC_Static)
return LinkageInfo::internal();
}
+
+if (Context.getLangOpts().HLSL &&
+Var->hasAttr())
+ return LinkageInfo::i
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/95331
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota closed https://github.com/llvm/llvm-project/pull/97362
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota approved this pull request.
LGTM!
https://github.com/llvm/llvm-project/pull/102227
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota created
https://github.com/llvm/llvm-project/pull/102275
Adds list of exported functions as named metadata node 'dx.exports`.
During CodeGen each exported functions is marked with an "hlsl.export"
attribute. Based on these attributes the DXILTranslateMetadata pass wil
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/102275
>From 340834e9c1ea12c8de4ee9f5a6b7c0191e96f489 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Tue, 6 Aug 2024 23:19:20 -0700
Subject: [PATCH 1/2] [HLSL] Add list of exported functions as named metadata
node '
https://github.com/hekota edited
https://github.com/llvm/llvm-project/pull/102275
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/102275
>From 340834e9c1ea12c8de4ee9f5a6b7c0191e96f489 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Tue, 6 Aug 2024 23:19:20 -0700
Subject: [PATCH 1/3] [HLSL] Add list of exported functions as named metadata
node '
https://github.com/hekota ready_for_review
https://github.com/llvm/llvm-project/pull/102275
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota edited
https://github.com/llvm/llvm-project/pull/102275
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
hekota wrote:
> Could this be an analysis pass which collect the list as a
> SmallVector instead of creating the list in 'dx.exports' metadata?
You mean the DXILFinalizeLinkage pass (coming soon) that needs a list of
entries and exported functions should get the information from "hlsl.shader"
hekota wrote:
> I mean DXILFinalizeLinkage pass could use an analysis pass to get the list of
> export functions. The collecting of the list happens in the analysis pass. No
> need to create a named metadata and remove it later.
Sounds good. It will probably be easier for the DXILFinalizeLinka
201 - 300 of 890 matches
Mail list logo