[clang] [HIP] Pass `-O0` by default for HIP no-RDC compilations (PR #211790)

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 24 08:53:22 PDT 2026


jhuber6 wrote:

> Was this behavior change requested by users?
> 
> HIP no-RDC is similar to C++ LTO here: the device link step is doing link-time work, and `clang-linker-wrapper` is playing a role similar to `ld.lld`. For consistency, I think the default should match C++ LTO / `ld.lld`: if the user does not pass any `-O`, we should not add `-O0` only for HIP no-RDC. Users who want LTO `O0` can still pass `-O0` explicitly.

Yeah, in general I agree, so I'm hoping that https://github.com/llvm/llvm-project/pull/211804 is an acceptable fix instead.

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


More information about the cfe-commits mailing list