[PATCH] D156928: [Clang][AMDGPU] Fix handling of -mcode-object-version=none arg

Jon Chesterfield via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 4 17:45:45 PDT 2023


JonChesterfield added a comment.

In D156928#4562412 <https://reviews.llvm.org/D156928#4562412>, @yaxunl wrote:

> Some control variables are per-module. Clang cannot emit control variables that have different values for different modules. Intrinsics should work since it can take an argument as its value.

Sure it can. In the most limited case, we could exactly replace the variables imported from source IR in the device libs based on command line variables with the same globals with the same flags. That would be NFC except it would no longer matter if the devicertl source was present.

There's just also other better things to be done as well, like not burning ABI decisions in the front end, or not using magic variables at all. But it's definitely not necessary to write constants in IR files that encode the same information as the command line flag. That's a whole indirect no-op that doesn't need to be there.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D156928



More information about the cfe-commits mailing list