[PATCH] D36802: AMDGPU: Insert __devicename__ macros

Tony Tye via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 16 16:19:31 PDT 2017


t-tye added inline comments.


================
Comment at: lib/Basic/Targets/AMDGPU.cpp:364-367
+  if (GPUName.empty())
+    return;
+
+  Builder.defineMacro(Twine("__") + Twine(GPUName) + Twine("__"));
----------------
Should this be the following since extra macros could be after it in the future:

```
if (!GPUName.empty())
  Builder.defineMacro(Twine("__") + Twine(GPUName) + Twine("__"));
```

Should we only be defining macros using the canonical target name (the one in column 1 of https://llvm.org/docs/AMDGPUUsage.html#processors) rather than the one specified on the command line?


https://reviews.llvm.org/D36802





More information about the cfe-commits mailing list