[PATCH] D57707: Add Triple::isAMDGPU

Yaxun Liu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 4 12:29:33 PST 2019


yaxunl created this revision.
yaxunl added reviewers: arsenm, rampitec, kzhuravl.
Herald added subscribers: dexonsmith, kristof.beyls, t-tye, tpr, dstuttard, javed.absar, wdng.

I have been bothered by missing Triple::isAMDGPU for long time. There is isNVPTX, isARM,
 why can't we have isAMDGPU?


https://reviews.llvm.org/D57707

Files:
  include/llvm/ADT/Triple.h


Index: include/llvm/ADT/Triple.h
===================================================================
--- include/llvm/ADT/Triple.h
+++ include/llvm/ADT/Triple.h
@@ -660,6 +660,10 @@
     return getArch() == Triple::nvptx || getArch() == Triple::nvptx64;
   }
 
+  bool isAMDGPU() const {
+    return getArch() == Triple::r600 || getArch() == Triple::amdgcn;
+  }
+
   /// Tests whether the target is Thumb (little and big endian).
   bool isThumb() const {
     return getArch() == Triple::thumb || getArch() == Triple::thumbeb;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57707.185124.patch
Type: text/x-patch
Size: 529 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190204/9d541c6c/attachment.bin>


More information about the llvm-commits mailing list