================
@@ -175,15 +175,33 @@ void AMDGCN::Linker::constructLinkAndEmitSpirvCommand(
constructLlvmLinkCommand(C, JA, Inputs, LinkedBCFile, Args);
- // Emit SPIR-V binary.
- llvm::opt::ArgStringList TrArgs{
- "--spirv-max-version=1.6",
- "--spirv-ext=+all",
- "--spirv-allow-unknown-intrinsics",
- "--spirv-lower-const-expr",
- "--spirv-preserve-auxdata",
- "--spirv-debug-info-version=nonsemantic-shader-200"};
- SPIRV::constructTranslateCommand(C, *this, JA, Output, LinkedBCFile, TrArgs);
+ bool UseSPIRVBackend = Args.hasFlag(
+ options::OPT_use_experimental_spirv_backend,
+ options::OPT_no_use_experimental_spirv_backend, /*Default=*/false);
+
+ // Emit SPIR-V binary either using the SPIRV backend or the translator.
+ if (UseSPIRVBackend) {
+ llvm::opt::ArgStringList CmdArgs;
+ const char *Triple =
+ C.getArgs().MakeArgString("-triple=spirv64-amd-amdhsa");
+ CmdArgs.append({"-cc1", Triple, "-emit-obj", LinkedBCFile.getFilename(),
----------------
jhuber6 wrote:
If we use the backend I don't know why we'd need special handling here. Right
now this target stops at LLVM-IR, just make it emit object instead of emit IR.
This flag should likely just disable this behavior entirely.
Note how `clang --target=spirv64--` works as I would expect.
https://github.com/llvm/llvm-project/pull/162282
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits