================
@@ -5285,6 +5310,20 @@ Action *Driver::ConstructPhaseAction(
: types::TY_LLVM_BC;
return C.MakeAction<BackendJobAction>(Input, Output);
}
+
+ // The SPIRV backend compilation path for HIP must avoid external
+ // dependencies. The default compilation path assembles and links its
+ // output, but the SPIRV assembler and linker are external tools. This code
+ // ensures the backend emits binary SPIRV directly to bypass those steps
and
+ // avoid failures. Without -save-temps, the compiler may already skip
+ // assembling and linking. With -save-temps, these steps must be explicitly
+ // disabled, as done here. We also force skipping these steps regardless of
+ // -save-temps to avoid relying on optimizations (unless -S is set).
+ if (UseSPIRVBackendForHipDeviceOnlyNoRDC && !Args.hasArg(options::OPT_S)) {
+ // The current HIP bundling expects the type to be types::TY_Image
+ return C.MakeAction<BackendJobAction>(Input, types::TY_Image);
+ }
----------------
jhuber6 wrote:
```suggestion
// The current HIP bundling expects the type to be types::TY_Image
if (UseSPIRVBackendForHipDeviceOnlyNoRDC && !Args.hasArg(options::OPT_S))
return C.MakeAction<BackendJobAction>(Input, types::TY_Image);
```
https://github.com/llvm/llvm-project/pull/167543
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits