[PATCH] D142499: [Clang][AMDGPU] Set LTO CG opt level based on Clang option

Scott Linder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 2 14:48:45 PST 2023


scott.linder added a comment.

Are there any thoughts on whether this is too ugly to live? It will be awkward to teach users the current default behavior without this change, but if we can accept it as a historical quirk that may be OK.

The primary driver for wanting the 1:1 mapping is an odd interaction between our debug info (only implemented for -O0 codegen currently, higher opt levels are WIP) and our implementation of `-fgpu-rdc` (currently this implies `-flto` as we don't support true device code-object linking).

A user who compiles and debugs without `-fgpu-rdc` cannot simply add it to their command-line, they will also need `-Xoffload-linker --lto-CGO0`. Of course, this is a temporary arrangement, but it also just seems "correct" to default to the 1:1 mapping.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142499/new/

https://reviews.llvm.org/D142499



More information about the cfe-commits mailing list