Skip to content

Commit 40254cb

Browse files
Henry Linjamäkilinehill
authored andcommitted
Disable SPIR-V extensions except ones needed by chipStar
1 parent 6161a08 commit 40254cb

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

clang/lib/Driver/ToolChains/HIPSPV.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,18 @@ void HIPSPV::Linker::constructLinkAndEmitSpirvCommand(
9999
// We need 1.2 when using warp-level primitivies via sub group extensions.
100100
// Strictly put we'd need 1.3 for the standard non-extension shuffle
101101
// operations, but it's not supported by any target yet.
102-
llvm::opt::ArgStringList TrArgs{"--spirv-max-version=1.2",
103-
"--spirv-ext=+all"};
102+
llvm::opt::ArgStringList TrArgs{
103+
"--spirv-max-version=1.2",
104+
"--spirv-ext=-all"
105+
106+
// TODO: Consider upstreaming -Xspirv-translator found in intel-llvm
107+
// repository and make it work for SPIR-V toolchains so chipStar may
108+
// control extensions it needs (if/when necessary).
109+
110+
// Needed for experimental indirect call support.
111+
",+SPV_INTEL_function_pointers"
112+
// Needed for shuffles below SPIR-V 1.3
113+
",+SPV_INTEL_subgroups"};
104114
InputInfo TrInput = InputInfo(types::TY_LLVM_BC, TempFile, "");
105115
SPIRV::constructTranslateCommand(C, *this, JA, Output, TrInput, TrArgs);
106116
}

0 commit comments

Comments
 (0)