Skip to content

[SYCL] Update a few SPIRV values in compileTimeProperties #8699

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions llvm/lib/SYCLLowerIR/CompileTimeProperties.def
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ SYCL_COMPILE_TIME_PROPERTY("sycl-dwidth", 6178, DecorValueTy::uint32)
SYCL_COMPILE_TIME_PROPERTY("sycl-latency", 6179, DecorValueTy::uint32)
SYCL_COMPILE_TIME_PROPERTY("sycl-read-write-mode", 6180, DecorValueTy::uint32)
SYCL_COMPILE_TIME_PROPERTY("sycl-maxburst", 6181, DecorValueTy::uint32)
SYCL_COMPILE_TIME_PROPERTY("sycl-alignment", 6182, DecorValueTy::uint32)
SYCL_COMPILE_TIME_PROPERTY("sycl-wait-request", 6183, DecorValueTy::uint32)
SYCL_COMPILE_TIME_PROPERTY("sycl-stable", 6184, DecorValueTy::boolean)
SYCL_COMPILE_TIME_PROPERTY("sycl-alignment", 44, DecorValueTy::uint32)
SYCL_COMPILE_TIME_PROPERTY("sycl-wait-request", 6182, DecorValueTy::uint32)
SYCL_COMPILE_TIME_PROPERTY("sycl-stable", 6183, DecorValueTy::boolean)
SYCL_COMPILE_TIME_PROPERTY("sycl-strict", 19, DecorValueTy::boolean)
7 changes: 6 additions & 1 deletion llvm/lib/SYCLLowerIR/CompileTimePropertiesPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ PreservedAnalyses CompileTimePropertiesPass::run(Module &M,
if (F.getCallingConv() != CallingConv::SPIR_KERNEL)
continue;

// Compile time properties on kernel arguments
{
SmallVector<Metadata *, 8> MDOps;
MDOps.reserve(F.arg_size());
Expand All @@ -345,8 +346,12 @@ PreservedAnalyses CompileTimePropertiesPass::run(Module &M,
SmallVector<Metadata *, 8> MDArgOps;
for (auto &Attribute : F.getAttributes().getParamAttrs(I)) {
if (MDNode *SPIRVMetadata =
attributeToDecorateMetadata(Ctx, Attribute))
attributeToDecorateMetadata(Ctx, Attribute)) {
// sycl-alignment is not collected to SPIRV.ParamDecoration
if (Attribute.getKindAsString() == "sycl-alignment")
continue;
MDArgOps.push_back(SPIRVMetadata);
}
}
if (!MDArgOps.empty())
FoundKernelProperties = true;
Expand Down
13 changes: 5 additions & 8 deletions llvm/test/tools/sycl-post-link/sycl-kernel-arg-annotations.ll
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ entry:
!1587 = !{i32 -1}
!1588 = !{i32 -1, i32 -1, i32 -1}
; CHECK-DAG: ![[PARMDECOR_CASE1]] = !{![[ARG:[0-9]+]]}
; CHECK-DAG: ![[ARG]] = !{![[ALIGN:[0-9]+]], ![[AWIDTH:[0-9]+]], ![[BL:[0-9]+]], ![[CONDUIT:[0-9]+]], ![[DWIDTH:[0-9]+]], ![[LATENCY:[0-9]+]], ![[MAXBURST:[0-9]+]], ![[RWMODE:[0-9]+]], ![[REGMAP:[0-9]+]], ![[STABLE:[0-9]+]], ![[STRICT:[0-9]+]], ![[WAITREQ:[0-9]+]]}
; CHECK-DAG: ![[ARG]] = !{![[AWIDTH:[0-9]+]], ![[BL:[0-9]+]], ![[CONDUIT:[0-9]+]], ![[DWIDTH:[0-9]+]], ![[LATENCY:[0-9]+]], ![[MAXBURST:[0-9]+]], ![[RWMODE:[0-9]+]], ![[REGMAP:[0-9]+]], ![[STABLE:[0-9]+]], ![[STRICT:[0-9]+]], ![[WAITREQ:[0-9]+]]}

; CHECK: ![[ALIGN]] = !{i32 6182, i32 4}
; CHECK: ![[AWIDTH]] = !{i32 6177, i32 32}
; CHECK: ![[BL]] = !{i32 5921, i32 10}
; CHECK: ![[CONDUIT]] = !{i32 6175, i32 1}
Expand All @@ -40,13 +39,11 @@ entry:
; CHECK: ![[MAXBURST]] = !{i32 6181, i32 3}
; CHECK: ![[RWMODE]] = !{i32 6180, i32 2}
; CHECK: ![[REGMAP]] = !{i32 6176, i32 1}
; CHECK: ![[STABLE]] = !{i32 6184, i32 1}
; CHECK: ![[STABLE]] = !{i32 6183, i32 1}
; CHECK: ![[STRICT]] = !{i32 19, i32 1}
; CHECK: ![[WAITREQ]] = !{i32 6183, i32 5}
; CHECK: ![[WAITREQ]] = !{i32 6182, i32 5}

; CHECK-DAG: ![[PARMDECOR_CASE2]] = !{![[ARG1:[0-9]+]], ![[ARG2:[0-9]+]], ![[ARG3:[0-9]+]]}
; CHECK-DAG: ![[ARG1]] = !{![[ALIGN1:[0-9]+]]}
; CHECK: ![[ALIGN1]] = !{i32 6182, i32 8}
; CHECK-DAG: ![[ARG2]] = !{}
; CHECK-DAG: ![[PARMDECOR_CASE2]] = !{![[ARG1:[0-9]+]], ![[ARG1:[0-9]+]], ![[ARG3:[0-9]+]]}
; CHECK-DAG: ![[ARG1]] = !{}
; CHECK-DAG: ![[ARG3]] = !{![[AWIDTH3:[0-9]+]]}
; CHECK: ![[AWIDTH3]] = !{i32 6177, i32 64}