Skip to content
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

Update spirv.Source. #14593

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions clang/lib/CodeGen/CodeGenModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1358,14 +1358,14 @@ void CodeGenModule::Release() {
TheModule.getOrInsertNamedMetadata("opencl.spir.version");
SPIRVerMD->addOperand(llvm::MDNode::get(Ctx, SPIRVerElts));
// We are trying to look like OpenCL C++ for SPIR-V translator.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The language mode is called "C++ for OpenCL".

Suggested change
// We are trying to look like OpenCL C++ for SPIR-V translator.
// We are trying to look like C++ for OpenCL for SPIR-V translator.

// 4 - OpenCL_CPP, 100000 - OpenCL C++ version 1.0
// 6 - CPP_for_OpenCL, 100000 - OpenCL C++ version 1.0
haonanya marked this conversation as resolved.
Show resolved Hide resolved
// 0 - ESIMD, if any kernel or function is an explicit SIMD one
int Lang = llvm::any_of(TheModule,
[](const auto &F) {
return F.getMetadata("sycl_explicit_simd");
})
? 0
: 4;
: 6;

llvm::Metadata *SPIRVSourceElts[] = {
llvm::ConstantAsMetadata::get(llvm::ConstantInt::get(Int32Ty, Lang)),
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CodeGenSYCL/function-attrs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ int main() {
//.
// CHECK: !{{[0-9]+}} = !{i32 1, !"wchar_size", i32 4}
// CHECK: !{{[0-9]+}} = !{i32 1, i32 2}
// CHECK: !{{[0-9]+}} = !{i32 4, i32 100000}
// CHECK: !{{[0-9]+}} = !{i32 6, i32 100000}
// CHECK: !{{[0-9]+}} = !{i32 {{.*}}}
// CHECK: !{{[0-9]+}} = !{}
// CHECK: ![[MD1]] = !{i32 {{.*}}}
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CodeGenSYCL/spir-opencl-version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ int main() {
// CHECK: !opencl.spir.version = !{[[SPIR:![0-9]+]]}
// CHECK: !spirv.Source = !{[[LANG:![0-9]+]]}
// CHECK: [[SPIR]] = !{i32 1, i32 2}
// CHECK: [[LANG]] = !{i32 4, i32 100000}
// CHECK: [[LANG]] = !{i32 6, i32 100000}
Loading