Skip to content

Commit ef2b170

Browse files
committed
[Sema][HLSL] Consolidate handling of HLSL attributes
This moves the sema checking of the entrypoint sensitive HLSL attributes all into one place. This ended up being kind of large for a couple of reasons: - I had to move the call to CheckHLSLEntryPoint later in ActOnFunctionDeclarator so that we do this after redeclarations and have access to all of the attributes. - We need to transfer the target shader stage onto the specified entry point before doing the checking. - I removed "library" from the HLSLShader attribute value enum and just go through a string to convert from the triple - the other way was confusing and brittle. Differential Revision: https://reviews.llvm.org/D158803
1 parent f2f5d6f commit ef2b170

File tree

11 files changed

+251
-117
lines changed

11 files changed

+251
-117
lines changed

clang/include/clang/Basic/Attr.td

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4133,24 +4133,14 @@ def HLSLShader : InheritableAttr {
41334133
let Spellings = [Microsoft<"shader">];
41344134
let Subjects = SubjectList<[HLSLEntry]>;
41354135
let LangOpts = [HLSL];
4136-
// NOTE:
4137-
// order for the enum should match order in llvm::Triple::EnvironmentType.
4138-
// ShaderType will be converted to llvm::Triple::EnvironmentType like
4139-
// (llvm::Triple::EnvironmentType)((uint32_t)ShaderType +
4140-
// (uint32_t)llvm::Triple::EnvironmentType::Pixel).
4141-
// This will avoid update code for convert when new shader type is added.
41424136
let Args = [
41434137
EnumArgument<"Type", "ShaderType",
4144-
[
4145-
"pixel", "vertex", "geometry", "hull", "domain", "compute",
4146-
"library", "raygeneration", "intersection", "anyhit",
4147-
"closesthit", "miss", "callable", "mesh", "amplification"
4148-
],
4149-
[
4150-
"Pixel", "Vertex", "Geometry", "Hull", "Domain", "Compute",
4151-
"Library", "RayGeneration", "Intersection", "AnyHit",
4152-
"ClosestHit", "Miss", "Callable", "Mesh", "Amplification"
4153-
]>
4138+
["pixel", "vertex", "geometry", "hull", "domain", "compute",
4139+
"raygeneration", "intersection", "anyhit", "closesthit",
4140+
"miss", "callable", "mesh", "amplification"],
4141+
["Pixel", "Vertex", "Geometry", "Hull", "Domain", "Compute",
4142+
"RayGeneration", "Intersection", "AnyHit", "ClosestHit",
4143+
"Miss", "Callable", "Mesh", "Amplification"]>
41544144
];
41554145
let Documentation = [HLSLSV_ShaderTypeAttrDocs];
41564146
}

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11869,7 +11869,7 @@ def err_std_source_location_impl_malformed : Error<
1186911869
"'std::source_location::__impl' must be standard-layout and have only two 'const char *' fields '_M_file_name' and '_M_function_name', and two integral fields '_M_line' and '_M_column'">;
1187011870

1187111871
// HLSL Diagnostics
11872-
def err_hlsl_attr_unsupported_in_stage : Error<"attribute %0 is unsupported in %select{Pixel|Vertex|Geometry|Hull|Domain|Compute|Library|RayGeneration|Intersection|AnyHit|ClosestHit|Miss|Callable|Mesh|Amplification|Invalid}1 shaders, requires %2">;
11872+
def err_hlsl_attr_unsupported_in_stage : Error<"attribute %0 is unsupported in '%1' shaders, requires %select{|one of the following: }2%3">;
1187311873
def err_hlsl_attr_invalid_type : Error<
1187411874
"attribute %0 only applies to a field or parameter of type '%1'">;
1187511875
def err_hlsl_attr_invalid_ast_node : Error<

clang/include/clang/Sema/Sema.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3013,7 +3013,13 @@ class Sema final {
30133013
QualType NewT, QualType OldT);
30143014
void CheckMain(FunctionDecl *FD, const DeclSpec &D);
30153015
void CheckMSVCRTEntryPoint(FunctionDecl *FD);
3016+
void ActOnHLSLTopLevelFunction(FunctionDecl *FD);
30163017
void CheckHLSLEntryPoint(FunctionDecl *FD);
3018+
void CheckHLSLSemanticAnnotation(FunctionDecl *EntryPoint, const Decl *Param,
3019+
const HLSLAnnotationAttr *AnnotationAttr);
3020+
void DiagnoseHLSLAttrStageMismatch(
3021+
const Attr *A, HLSLShaderAttr::ShaderType Stage,
3022+
std::initializer_list<HLSLShaderAttr::ShaderType> AllowedStages);
30173023
Attr *getImplicitCodeSegOrSectionAttrForFunction(const FunctionDecl *FD,
30183024
bool IsDefinition);
30193025
void CheckFunctionOrTemplateParamDeclarator(Scope *S, Declarator &D);

clang/lib/Sema/SemaDecl.cpp

Lines changed: 112 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -10338,33 +10338,6 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC,
1033810338
}
1033910339
}
1034010340

10341-
if (getLangOpts().HLSL) {
10342-
auto &TargetInfo = getASTContext().getTargetInfo();
10343-
// Skip operator overload which not identifier.
10344-
// Also make sure NewFD is in translation-unit scope.
10345-
if (!NewFD->isInvalidDecl() && Name.isIdentifier() &&
10346-
NewFD->getName() == TargetInfo.getTargetOpts().HLSLEntry &&
10347-
S->getDepth() == 0) {
10348-
CheckHLSLEntryPoint(NewFD);
10349-
if (!NewFD->isInvalidDecl()) {
10350-
auto Env = TargetInfo.getTriple().getEnvironment();
10351-
HLSLShaderAttr::ShaderType ShaderType =
10352-
static_cast<HLSLShaderAttr::ShaderType>(
10353-
hlsl::getStageFromEnvironment(Env));
10354-
// To share code with HLSLShaderAttr, add HLSLShaderAttr to entry
10355-
// function.
10356-
if (HLSLShaderAttr *NT = NewFD->getAttr<HLSLShaderAttr>()) {
10357-
if (NT->getType() != ShaderType)
10358-
Diag(NT->getLocation(), diag::err_hlsl_entry_shader_attr_mismatch)
10359-
<< NT;
10360-
} else {
10361-
NewFD->addAttr(HLSLShaderAttr::Create(Context, ShaderType,
10362-
NewFD->getBeginLoc()));
10363-
}
10364-
}
10365-
}
10366-
}
10367-
1036810341
if (!getLangOpts().CPlusPlus) {
1036910342
// Perform semantic checking on the function declaration.
1037010343
if (!NewFD->isInvalidDecl() && NewFD->isMain())
@@ -10654,6 +10627,15 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC,
1065410627
}
1065510628
}
1065610629

10630+
if (getLangOpts().HLSL && D.isFunctionDefinition()) {
10631+
// Any top level function could potentially be specified as an entry.
10632+
if (!NewFD->isInvalidDecl() && S->getDepth() == 0 && Name.isIdentifier())
10633+
ActOnHLSLTopLevelFunction(NewFD);
10634+
10635+
if (NewFD->hasAttr<HLSLShaderAttr>())
10636+
CheckHLSLEntryPoint(NewFD);
10637+
}
10638+
1065710639
// If this is the first declaration of a library builtin function, add
1065810640
// attributes as appropriate.
1065910641
if (!D.isRedeclaration()) {
@@ -12381,24 +12363,84 @@ void Sema::CheckMSVCRTEntryPoint(FunctionDecl *FD) {
1238112363
}
1238212364
}
1238312365

12384-
void Sema::CheckHLSLEntryPoint(FunctionDecl *FD) {
12366+
void Sema::ActOnHLSLTopLevelFunction(FunctionDecl *FD) {
1238512367
auto &TargetInfo = getASTContext().getTargetInfo();
12386-
auto const Triple = TargetInfo.getTriple();
12387-
switch (Triple.getEnvironment()) {
12388-
default:
12389-
// FIXME: check all shader profiles.
12368+
12369+
if (FD->getName() != TargetInfo.getTargetOpts().HLSLEntry)
12370+
return;
12371+
12372+
StringRef Env = TargetInfo.getTriple().getEnvironmentName();
12373+
HLSLShaderAttr::ShaderType ShaderType;
12374+
if (HLSLShaderAttr::ConvertStrToShaderType(Env, ShaderType)) {
12375+
if (const auto *Shader = FD->getAttr<HLSLShaderAttr>()) {
12376+
// The entry point is already annotated - check that it matches the
12377+
// triple.
12378+
if (Shader->getType() != ShaderType) {
12379+
Diag(Shader->getLocation(), diag::err_hlsl_entry_shader_attr_mismatch)
12380+
<< Shader;
12381+
FD->setInvalidDecl();
12382+
}
12383+
} else {
12384+
// Implicitly add the shader attribute if the entry function isn't
12385+
// explicitly annotated.
12386+
FD->addAttr(HLSLShaderAttr::CreateImplicit(Context, ShaderType,
12387+
FD->getBeginLoc()));
12388+
}
12389+
} else {
12390+
switch (TargetInfo.getTriple().getEnvironment()) {
12391+
case llvm::Triple::UnknownEnvironment:
12392+
case llvm::Triple::Library:
12393+
break;
12394+
default:
12395+
// TODO: This should probably just be llvm_unreachable and we should
12396+
// reject triples with random ABIs and such when we build the target.
12397+
// For now, crash.
12398+
llvm::report_fatal_error("Unhandled environment in triple");
12399+
}
12400+
}
12401+
}
12402+
12403+
void Sema::CheckHLSLEntryPoint(FunctionDecl *FD) {
12404+
const auto *ShaderAttr = FD->getAttr<HLSLShaderAttr>();
12405+
assert(ShaderAttr && "Entry point has no shader attribute");
12406+
HLSLShaderAttr::ShaderType ST = ShaderAttr->getType();
12407+
12408+
switch (ST) {
12409+
case HLSLShaderAttr::Pixel:
12410+
case HLSLShaderAttr::Vertex:
12411+
case HLSLShaderAttr::Geometry:
12412+
case HLSLShaderAttr::Hull:
12413+
case HLSLShaderAttr::Domain:
12414+
case HLSLShaderAttr::RayGeneration:
12415+
case HLSLShaderAttr::Intersection:
12416+
case HLSLShaderAttr::AnyHit:
12417+
case HLSLShaderAttr::ClosestHit:
12418+
case HLSLShaderAttr::Miss:
12419+
case HLSLShaderAttr::Callable:
12420+
if (const auto *NT = FD->getAttr<HLSLNumThreadsAttr>()) {
12421+
DiagnoseHLSLAttrStageMismatch(NT, ST,
12422+
{HLSLShaderAttr::Compute,
12423+
HLSLShaderAttr::Amplification,
12424+
HLSLShaderAttr::Mesh});
12425+
FD->setInvalidDecl();
12426+
}
1239012427
break;
12391-
case llvm::Triple::EnvironmentType::Compute:
12428+
12429+
case HLSLShaderAttr::Compute:
12430+
case HLSLShaderAttr::Amplification:
12431+
case HLSLShaderAttr::Mesh:
1239212432
if (!FD->hasAttr<HLSLNumThreadsAttr>()) {
1239312433
Diag(FD->getLocation(), diag::err_hlsl_missing_numthreads)
12394-
<< Triple.getEnvironmentName();
12434+
<< HLSLShaderAttr::ConvertShaderTypeToStr(ST);
1239512435
FD->setInvalidDecl();
1239612436
}
1239712437
break;
1239812438
}
1239912439

12400-
for (const auto *Param : FD->parameters()) {
12401-
if (!Param->hasAttr<HLSLAnnotationAttr>()) {
12440+
for (ParmVarDecl *Param : FD->parameters()) {
12441+
if (const auto *AnnotationAttr = Param->getAttr<HLSLAnnotationAttr>()) {
12442+
CheckHLSLSemanticAnnotation(FD, Param, AnnotationAttr);
12443+
} else {
1240212444
// FIXME: Handle struct parameters where annotations are on struct fields.
1240312445
// See: https://github.com/llvm/llvm-project/issues/57875
1240412446
Diag(FD->getLocation(), diag::err_hlsl_missing_semantic_annotation);
@@ -12409,6 +12451,40 @@ void Sema::CheckHLSLEntryPoint(FunctionDecl *FD) {
1240912451
// FIXME: Verify return type semantic annotation.
1241012452
}
1241112453

12454+
void Sema::CheckHLSLSemanticAnnotation(
12455+
FunctionDecl *EntryPoint, const Decl *Param,
12456+
const HLSLAnnotationAttr *AnnotationAttr) {
12457+
auto *ShaderAttr = EntryPoint->getAttr<HLSLShaderAttr>();
12458+
assert(ShaderAttr && "Entry point has no shader attribute");
12459+
HLSLShaderAttr::ShaderType ST = ShaderAttr->getType();
12460+
12461+
switch (AnnotationAttr->getKind()) {
12462+
case attr::HLSLSV_DispatchThreadID:
12463+
case attr::HLSLSV_GroupIndex:
12464+
if (ST == HLSLShaderAttr::Compute)
12465+
return;
12466+
DiagnoseHLSLAttrStageMismatch(AnnotationAttr, ST,
12467+
{HLSLShaderAttr::Compute});
12468+
break;
12469+
default:
12470+
llvm_unreachable("Unknown HLSLAnnotationAttr");
12471+
}
12472+
}
12473+
12474+
void Sema::DiagnoseHLSLAttrStageMismatch(
12475+
const Attr *A, HLSLShaderAttr::ShaderType Stage,
12476+
std::initializer_list<HLSLShaderAttr::ShaderType> AllowedStages) {
12477+
SmallVector<StringRef, 8> StageStrings;
12478+
llvm::transform(AllowedStages, std::back_inserter(StageStrings),
12479+
[](HLSLShaderAttr::ShaderType ST) {
12480+
return StringRef(
12481+
HLSLShaderAttr::ConvertShaderTypeToStr(ST));
12482+
});
12483+
Diag(A->getLoc(), diag::err_hlsl_attr_unsupported_in_stage)
12484+
<< A << HLSLShaderAttr::ConvertShaderTypeToStr(Stage)
12485+
<< (AllowedStages.size() != 1) << join(StageStrings, ", ");
12486+
}
12487+
1241212488
bool Sema::CheckForConstantInitializer(Expr *Init, QualType DclT) {
1241312489
// FIXME: Need strict checking. In C89, we need to check for
1241412490
// any assignment, increment, decrement, function-calls, or

clang/lib/Sema/SemaDeclAttr.cpp

Lines changed: 4 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -7065,20 +7065,8 @@ static void handleUuidAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
70657065
}
70667066

70677067
static void handleHLSLNumThreadsAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
7068-
using llvm::Triple;
7069-
Triple Target = S.Context.getTargetInfo().getTriple();
7070-
auto Env = S.Context.getTargetInfo().getTriple().getEnvironment();
7071-
if (!llvm::is_contained({Triple::Compute, Triple::Mesh, Triple::Amplification,
7072-
Triple::Library},
7073-
Env)) {
7074-
uint32_t Pipeline =
7075-
static_cast<uint32_t>(hlsl::getStageFromEnvironment(Env));
7076-
S.Diag(AL.getLoc(), diag::err_hlsl_attr_unsupported_in_stage)
7077-
<< AL << Pipeline << "Compute, Amplification, Mesh or Library";
7078-
return;
7079-
}
7080-
7081-
llvm::VersionTuple SMVersion = Target.getOSVersion();
7068+
llvm::VersionTuple SMVersion =
7069+
S.Context.getTargetInfo().getTriple().getOSVersion();
70827070
uint32_t ZMax = 1024;
70837071
uint32_t ThreadMax = 1024;
70847072
if (SMVersion.getMajor() <= 4) {
@@ -7137,21 +7125,6 @@ HLSLNumThreadsAttr *Sema::mergeHLSLNumThreadsAttr(Decl *D,
71377125
return ::new (Context) HLSLNumThreadsAttr(Context, AL, X, Y, Z);
71387126
}
71397127

7140-
static void handleHLSLSVGroupIndexAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
7141-
using llvm::Triple;
7142-
auto Env = S.Context.getTargetInfo().getTriple().getEnvironment();
7143-
if (Env != Triple::Compute && Env != Triple::Library) {
7144-
// FIXME: it is OK for a compute shader entry and pixel shader entry live in
7145-
// same HLSL file. Issue https://github.com/llvm/llvm-project/issues/57880.
7146-
ShaderStage Pipeline = hlsl::getStageFromEnvironment(Env);
7147-
S.Diag(AL.getLoc(), diag::err_hlsl_attr_unsupported_in_stage)
7148-
<< AL << (uint32_t)Pipeline << "Compute";
7149-
return;
7150-
}
7151-
7152-
D->addAttr(::new (S.Context) HLSLSV_GroupIndexAttr(S.Context, AL));
7153-
}
7154-
71557128
static bool isLegalTypeForHLSLSV_DispatchThreadID(QualType T) {
71567129
if (!T->hasUnsignedIntegerRepresentation())
71577130
return false;
@@ -7162,23 +7135,6 @@ static bool isLegalTypeForHLSLSV_DispatchThreadID(QualType T) {
71627135

71637136
static void handleHLSLSV_DispatchThreadIDAttr(Sema &S, Decl *D,
71647137
const ParsedAttr &AL) {
7165-
using llvm::Triple;
7166-
Triple Target = S.Context.getTargetInfo().getTriple();
7167-
// FIXME: it is OK for a compute shader entry and pixel shader entry live in
7168-
// same HLSL file.Issue https://github.com/llvm/llvm-project/issues/57880.
7169-
if (Target.getEnvironment() != Triple::Compute &&
7170-
Target.getEnvironment() != Triple::Library) {
7171-
uint32_t Pipeline =
7172-
(uint32_t)S.Context.getTargetInfo().getTriple().getEnvironment() -
7173-
(uint32_t)llvm::Triple::Pixel;
7174-
S.Diag(AL.getLoc(), diag::err_hlsl_attr_unsupported_in_stage)
7175-
<< AL << Pipeline << "Compute";
7176-
return;
7177-
}
7178-
7179-
// FIXME: report warning and ignore semantic when cannot apply on the Decl.
7180-
// See https://github.com/llvm/llvm-project/issues/57916.
7181-
71827138
// FIXME: support semantic on field.
71837139
// See https://github.com/llvm/llvm-project/issues/57889.
71847140
if (isa<FieldDecl>(D)) {
@@ -7204,11 +7160,7 @@ static void handleHLSLShaderAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
72047160
return;
72057161

72067162
HLSLShaderAttr::ShaderType ShaderType;
7207-
if (!HLSLShaderAttr::ConvertStrToShaderType(Str, ShaderType) ||
7208-
// Library is added to help convert HLSLShaderAttr::ShaderType to
7209-
// llvm::Triple::EnviromentType. It is not a legal
7210-
// HLSLShaderAttr::ShaderType.
7211-
ShaderType == HLSLShaderAttr::Library) {
7163+
if (!HLSLShaderAttr::ConvertStrToShaderType(Str, ShaderType)) {
72127164
S.Diag(AL.getLoc(), diag::warn_attribute_type_not_supported)
72137165
<< AL << Str << ArgLoc;
72147166
return;
@@ -9347,7 +9299,7 @@ ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D, const ParsedAttr &AL,
93479299
handleHLSLNumThreadsAttr(S, D, AL);
93489300
break;
93499301
case ParsedAttr::AT_HLSLSV_GroupIndex:
9350-
handleHLSLSVGroupIndexAttr(S, D, AL);
9302+
handleSimpleAttribute<HLSLSV_GroupIndexAttr>(S, D, AL);
93519303
break;
93529304
case ParsedAttr::AT_HLSLSV_DispatchThreadID:
93539305
handleHLSLSV_DispatchThreadIDAttr(S, D, AL);

clang/test/CodeGenHLSL/GlobalDestructors.hlsl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ void Wag() {
4141
int Pupper::Count = 0;
4242

4343
[numthreads(1,1,1)]
44+
[shader("compute")]
4445
void main(unsigned GI : SV_GroupIndex) {
4546
Wag();
4647
}

clang/test/SemaHLSL/Semantics/entry_parameter.hlsl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -x hlsl -finclude-default-header -ast-dump -o - %s | FileCheck %s
2-
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-mesh -x hlsl -ast-dump -finclude-default-header -verify -o - %s
1+
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -hlsl-entry CSMain -x hlsl -finclude-default-header -ast-dump -o - %s | FileCheck %s
2+
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-mesh -hlsl-entry CSMain -x hlsl -finclude-default-header -verify -o - %s
33

44
[numthreads(8,8,1)]
5-
// expected-error@+2 {{attribute 'SV_GroupIndex' is unsupported in Mesh shaders, requires Compute}}
6-
// expected-error@+1 {{attribute 'SV_DispatchThreadID' is unsupported in Mesh shaders, requires Compute}}
5+
// expected-error@+2 {{attribute 'SV_GroupIndex' is unsupported in 'mesh' shaders, requires compute}}
6+
// expected-error@+1 {{attribute 'SV_DispatchThreadID' is unsupported in 'mesh' shaders, requires compute}}
77
void CSMain(int GI : SV_GroupIndex, uint ID : SV_DispatchThreadID) {
88
// CHECK: FunctionDecl 0x{{[0-9a-fA-F]+}} <{{.*}}> line:[[@LINE-1]]:6 CSMain 'void (int, uint)'
99
// CHECK-NEXT: ParmVarDecl 0x{{[0-9a-fA-F]+}} <{{.*}}> col:17 GI 'int'
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -x hlsl -o - %s -verify
2+
3+
// expected-no-error
4+
[shader("compute")][numthreads(32,1,1)]
5+
void compute(int GI : SV_GroupIndex) {}
6+
7+
// expected-error@+2 {{attribute 'SV_GroupIndex' is unsupported in 'pixel' shaders}}
8+
[shader("pixel")]
9+
void pixel(int GI : SV_GroupIndex) {}
10+
11+
// expected-error@+2 {{attribute 'SV_GroupIndex' is unsupported in 'vertex' shaders}}
12+
[shader("vertex")]
13+
void vertex(int GI : SV_GroupIndex) {}
14+
15+
// expected-error@+2 {{attribute 'SV_GroupIndex' is unsupported in 'geometry' shaders}}
16+
[shader("geometry")]
17+
void geometry(int GI : SV_GroupIndex) {}
18+
19+
// expected-error@+2 {{attribute 'SV_GroupIndex' is unsupported in 'domain' shaders}}
20+
[shader("domain")]
21+
void domain(int GI : SV_GroupIndex) {}
22+
23+
// expected-error@+2 {{attribute 'SV_GroupIndex' is unsupported in 'amplification' shaders}}
24+
[shader("amplification")][numthreads(32,1,1)]
25+
void amplification(int GI : SV_GroupIndex) {}
26+
27+
// expected-error@+2 {{attribute 'SV_GroupIndex' is unsupported in 'mesh' shaders}}
28+
[shader("mesh")][numthreads(32,1,1)]
29+
void mesh(int GI : SV_GroupIndex) {}

clang/test/SemaHLSL/entry.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
// Make sure add HLSLShaderAttr along with HLSLNumThreadsAttr.
66
// CHECK:HLSLNumThreadsAttr 0x{{.*}} <line:10:2, col:18> 1 1 1
7-
// CHECK:HLSLShaderAttr 0x{{.*}} <line:13:1> Compute
7+
// CHECK:HLSLShaderAttr 0x{{.*}} <line:13:1> Implicit Compute
88

99
#ifdef WITH_NUM_THREADS
1010
[numthreads(1,1,1)]

0 commit comments

Comments
 (0)