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

Disable SPIR-V extensions except ones needed by chipStar #4

Merged
merged 1 commit into from
Dec 18, 2023
Merged
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
14 changes: 12 additions & 2 deletions clang/lib/Driver/ToolChains/HIPSPV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,18 @@ void HIPSPV::Linker::constructLinkAndEmitSpirvCommand(
// We need 1.2 when using warp-level primitivies via sub group extensions.
// Strictly put we'd need 1.3 for the standard non-extension shuffle
// operations, but it's not supported by any target yet.
llvm::opt::ArgStringList TrArgs{"--spirv-max-version=1.2",
"--spirv-ext=+all"};
llvm::opt::ArgStringList TrArgs{
"--spirv-max-version=1.2",
"--spirv-ext=-all"

// TODO: Consider upstreaming -Xspirv-translator found in intel-llvm
// repository and make it work for SPIR-V toolchains so chipStar may
// control extensions it needs (if/when necessary).

// Needed for experimental indirect call support.
",+SPV_INTEL_function_pointers"
// Needed for shuffles below SPIR-V 1.3
",+SPV_INTEL_subgroups"};
InputInfo TrInput = InputInfo(types::TY_LLVM_BC, TempFile, "");
SPIRV::constructTranslateCommand(C, *this, JA, Output, TrInput, TrArgs);
}
Expand Down