[PATCH] D145343: [AMDGPU] Emit predefined macro `__AMDGCN_CUMODE__`

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 12 08:05:44 PDT 2023


yaxunl added inline comments.


================
Comment at: clang/include/clang/Basic/DiagnosticDriverKinds.td:121-123
+def warn_drv_unsupported_option_for_processor : Warning<
+  "ignoring '%0' option as it is not currently supported for processor '%1'">,
+  InGroup<OptionIgnored>;
----------------
arsenm wrote:
> I'm surprised there already isn't a warning for this?
I am surprised too. Before this patch, there is no check and no handling of unsupported target features in Clang. clang just blindly adds target features specified in the command line and relies on the backend to handle them properly.

This patch enables Clang to warn and ignore unsupported target features.


================
Comment at: clang/lib/Driver/ToolChains/CommonArgs.cpp:146
+    return false;
+  return TargetFeature == "no-cumode";
+}
----------------
arsenm wrote:
> I don't understand the use of "no-cumode". Where is this defined?
This function is called by clang driver. The argument TargetFeature is the target feature command line option to be checked, with `-m` removed, e.g. `-mcumode` or `-mno-cumode` passed to this function as "cumode" or "no-cumode".


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

https://reviews.llvm.org/D145343



More information about the cfe-commits mailing list