[clang] [AMDGPU][SPIR-V] Fix treating SPIR-V input as the wrong LLVM-IR (PR #202986)

Dmitry Sidorov via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 18 05:42:40 PDT 2026


MrSidims wrote:

It seems like this patch is not enough for a case, when we have multiple offload-arch (one of which is SPIR-V) and -no-lto is passed - in this case -no-lto will leak to SPIR-V compilation.

I have 2 drafts for the fix:
1. Insert the !Triple.isSPIRV() in 2 more places to force ignore -no-lto;
2. Do something different actually by introducing an overload to -no-lto option, which would also accept a string argument to specify for which architecture apply it.

While option 1 is easy and have a small blast, I personally lean towards option 2. WDYT?

@jhuber6 @AlexVlx @mgcarrasco @sarnex 

https://github.com/llvm/llvm-project/pull/202986


More information about the cfe-commits mailing list