[PATCH] D57707: Add Triple::isAMDGPU
Yaxun Liu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Mar 22 11:45:39 PDT 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rG314deab9af94: Add Triple::isAMDGPU (authored by yaxunl).
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.
Changed prior to commit:
https://reviews.llvm.org/D57707?vs=185136&id=251908#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D57707/new/
https://reviews.llvm.org/D57707
Files:
llvm/include/llvm/ADT/Triple.h
llvm/lib/Analysis/TargetLibraryInfo.cpp
Index: llvm/lib/Analysis/TargetLibraryInfo.cpp
===================================================================
--- llvm/lib/Analysis/TargetLibraryInfo.cpp
+++ llvm/lib/Analysis/TargetLibraryInfo.cpp
@@ -105,14 +105,12 @@
TLI.setShouldExtI32Return(ShouldExtI32Return);
TLI.setShouldSignExtI32Param(ShouldSignExtI32Param);
- if (T.getArch() == Triple::r600 ||
- T.getArch() == Triple::amdgcn)
+ if (T.isAMDGPU())
TLI.disableAllFunctions();
// There are no library implementations of memcpy and memset for AMD gpus and
// these can be difficult to lower in the backend.
- if (T.getArch() == Triple::r600 ||
- T.getArch() == Triple::amdgcn) {
+ if (T.isAMDGPU()) {
TLI.setUnavailable(LibFunc_memcpy);
TLI.setUnavailable(LibFunc_memset);
TLI.setUnavailable(LibFunc_memset_pattern16);
Index: llvm/include/llvm/ADT/Triple.h
===================================================================
--- llvm/include/llvm/ADT/Triple.h
+++ llvm/include/llvm/ADT/Triple.h
@@ -691,6 +691,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.251908.patch
Type: text/x-patch
Size: 1377 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200322/f7658ef7/attachment.bin>
More information about the llvm-commits
mailing list