[PATCH] D119026: [HIP] Emit amdgpu_code_object_version module flag

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 4 15:10:00 PST 2022


yaxunl added inline comments.


================
Comment at: clang/lib/CodeGen/CodeGenModule.cpp:575
+    // times 100.
+    if (getTarget().getTargetOpts().CodeObjectVersion != "none") {
+      unsigned CodeObjVer;
----------------
tra wrote:
> When will it ever be set to `none`? Does the new option parser enforce the default & version values specified in the tablegen?
> If so, then it should never be `none`.
> If the `Values` specified for the option are not enforced, then the condition will be true if user specifies any invalid value other than `none`.
> 
Normal HIP programs should only use `-mcode-object-version={2|3|4|5}`. clang driver enforces that.

ROCm device library need to be compiled with `-Xclang -mcode-object-version=none` so that the module flag is not emitted. Since this use case is not for common users,  `-mcode-object-version=none` can only be used with -cc1.


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

https://reviews.llvm.org/D119026



More information about the cfe-commits mailing list