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

Clean up OpenCL compilation into SPIR-V. #4375

Merged
merged 1 commit into from
Jan 24, 2023

Conversation

AnastasiaStulova
Copy link
Contributor

This change removes any references to Arm in SPIR-V compiler for OpenCL as there isn't anything specific to Arm in the compilation process. It also avoids using Arm specific workaround because SPIR-V compilation in clang doesn't suffer from the same limitation.

This change also makes explicit the fact that compilation uses llvm-spirv as clang now has internal SPIR-V support too which should be added here once it matures.

@AnastasiaStulova
Copy link
Contributor Author

Copy link
Member

@RubenRBS RubenRBS left a comment

Choose a reason for hiding this comment

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

Hi! Thanks for this.
Unfortunately as this changes compiler ids, we can't merge as-is, as old links with these compilers would break.
To fix this, either leave the old ids (Which maybe not the best idea given that removing arm references is the point of this PR), or for every changed compiler id, add a prop like:
compiler.<newid>.alias=<oldid> so that old links will be able to still find the compiler

This change removes any references to Arm in SPIR-V
compiler for OpenCL as there isn't anything specific
to Arm in the compilation process. It also avoids
using Arm specific workaround because SPIR-V
compilation in clang doesn't suffer from the same
limitation.

This change also makes explicit the fact that
compilation uses llvm-spirv as clang now has
internal SPIR-V support too which should be added
here once it matures.
@AnastasiaStulova
Copy link
Contributor Author

Hi! Thanks for this. Unfortunately as this changes compiler ids, we can't merge as-is, as old links with these compilers would break. To fix this, either leave the old ids (Which maybe not the best idea given that removing arm references is the point of this PR), or for every changed compiler id, add a prop like: compiler.<newid>.alias=<oldid> so that old links will be able to still find the compiler

Thanks for the suggestion. I have added alias to all the compilers being renamed.

Copy link
Member

@RubenRBS RubenRBS left a comment

Choose a reason for hiding this comment

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

Changes look great now, thanks so much for taking the time to fix the id issue. I have one final question regarding the default options before we merge

group.armcpp4oclclang32spir.compilerType=spirv
group.armcpp4oclclang32spir.supportsExecute=false
group.armcpp4oclclang32spir.instructionSet=arm32
# The -Dkernel= -D__kernel= workaround is required to prevent the Clang crash reported in https://llvm.org/PR50841
Copy link
Member

Choose a reason for hiding this comment

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

As far as I can see, your PR fixing this hasn't yet been merged, right? (LLVM's issue tracker is a bit hard to read, so sorry if I missed something) Do we not need the workaround anymore?

Copy link
Member

Choose a reason for hiding this comment

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

@AnastasiaStulova thanks again for your contribution: we'd love to merge. Can you answer @RubenRBS 's question so we know where we are on this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry for delay, this clang bug is only for compiling to Arm targets. When we compile for SPIR/SPIR-V: -triple spir, -triple spir64, -triple spirv32 or -triple spirv64 no workaround is needed as clang just compiles correctly.

@mattgodbolt
Copy link
Member

Thanks: I'm going to merge this so we don't get too stale. Sorry for the delay.

@mattgodbolt mattgodbolt merged commit 4ba1ed9 into compiler-explorer:main Jan 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants