Skip to content

How to emit SPIRV and how to emit LLVM? #5608

Answered by MrSidims
seanbaxter asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, I usually use:
clang++ -fsycl -fsycl-device-only test.cpp - to emit .bc file
and
clang++ -fsycl -fsycl-device-only -fno-sycl-use-bitcode test.cpp to emit .spv file

I'm unsure, if -fno-sycl-use-bitcode option works with dpcpp, so in this case I would suggest:
dpcpp -fsycl-device-only test.cpp - this alone will emit .bc file
llvm-spirv --spirv-ext=+all test.bc - this will translate it to .spv file

and llvm-dis / llvm-spirv --to-text are used to emit test formats for IR and SPV

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by alexbatashev
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #2889 on February 18, 2022 06:46.