[PATCH] D98746: [clang][amdgpu] Use implicit code object default

Tony Tye via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 16 16:55:54 PDT 2021


t-tye added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/Clang.cpp:1115-1124
+  // Currently defaults to 3 in AMDGPUBaseInfo.cpp
+  // Using that default lets clang emit IR for amdgcn when llvm has been built
+  // without that target, provided the user wants this code object version
+  if (CodeObjVer != 3) {
+    CmdArgs.insert(CmdArgs.begin() + 1,
+                   Args.MakeArgString(Twine("--amdhsa-code-object-version=") +
+                                      Twine(CodeObjVer)));
----------------
This seem rather fragile. If the backend default changes and this code is not updated it will likely result in creating the wrong code object version.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98746



More information about the cfe-commits mailing list