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

Matt Arsenault via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 12 09:26:43 PDT 2023


arsenm added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/CommonArgs.cpp:146
+    return false;
+  return TargetFeature == "no-cumode";
+}
----------------
yaxunl wrote:
> 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".
Can this use something like


```
  if (!DriverArgs.hasFlag(options::OPT_fgpu_sanitize,
                          options::OPT_fno_gpu_sanitize, true))
    return true;
```

to make it clear this is checking the flag? At a minimum this needs to be renamed to indicate it's a flag and not the actual subtarget feature name 


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

https://reviews.llvm.org/D145343



More information about the cfe-commits mailing list