[LinkerWrapper] Fix 'save-temps' when targeting SPIR-V (#144605)

Summary:
The logic here is flawed, it was only intended to apply to the CPU case
where we use the linker passed in on the command line. This was falsely
applying to SPIR-V which caused issues.
This commit is contained in:
Joseph Huber
2025-06-17 16:16:37 -05:00
committed by GitHub
parent 844e41c2ac
commit 6fb36db481

View File

@@ -268,7 +268,8 @@ Expected<std::string> findProgram(StringRef Name, ArrayRef<StringRef> Paths) {
bool linkerSupportsLTO(const ArgList &Args) {
llvm::Triple Triple(Args.getLastArgValue(OPT_triple_EQ));
return Triple.isNVPTX() || Triple.isAMDGPU() ||
Args.getLastArgValue(OPT_linker_path_EQ).ends_with("lld");
(!Triple.isGPU() &&
Args.getLastArgValue(OPT_linker_path_EQ).ends_with("lld"));
}
/// Returns the hashed value for a constant string.