[PATCH] D37380: Triple: Add AMDPAL operating system type
Tim Renouf via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 5 07:48:10 PDT 2017
tpr updated this revision to Diff 113859.
tpr added a comment.
Herald added a subscriber: wdng.
Added test, although it's pointless for now as it passes even without the code
change.
https://reviews.llvm.org/D37380
Files:
include/llvm/ADT/Triple.h
lib/Support/Triple.cpp
lib/Target/AMDGPU/AMDGPUSubtarget.h
test/CodeGen/AMDGPU/amdpal.ll
Index: test/CodeGen/AMDGPU/amdpal.ll
===================================================================
--- /dev/null
+++ test/CodeGen/AMDGPU/amdpal.ll
@@ -0,0 +1,10 @@
+; RUN: llc < %s -mtriple=amdgcn--amdpal -mcpu=tahiti | FileCheck --check-prefix=PAL %s
+
+; PAL: .AMDGPU.config
+
+define amdgpu_kernel void @simple(i32 addrspace(1)* %out) {
+entry:
+ store i32 0, i32 addrspace(1)* %out
+ ret void
+}
+
Index: lib/Target/AMDGPU/AMDGPUSubtarget.h
===================================================================
--- lib/Target/AMDGPU/AMDGPUSubtarget.h
+++ lib/Target/AMDGPU/AMDGPUSubtarget.h
@@ -214,6 +214,10 @@
TargetTriple.getEnvironmentName() == "amdgizcl";
}
+ bool isAmdPalOS() const {
+ return TargetTriple.getOS() == Triple::AMDPAL;
+ }
+
Generation getGeneration() const {
return Gen;
}
Index: lib/Support/Triple.cpp
===================================================================
--- lib/Support/Triple.cpp
+++ lib/Support/Triple.cpp
@@ -207,6 +207,7 @@
case WatchOS: return "watchos";
case Mesa3D: return "mesa3d";
case Contiki: return "contiki";
+ case AMDPAL: return "amdpal";
}
llvm_unreachable("Invalid OSType");
@@ -498,6 +499,7 @@
.StartsWith("watchos", Triple::WatchOS)
.StartsWith("mesa3d", Triple::Mesa3D)
.StartsWith("contiki", Triple::Contiki)
+ .StartsWith("amdpal", Triple::AMDPAL)
.Default(Triple::UnknownOS);
}
Index: include/llvm/ADT/Triple.h
===================================================================
--- include/llvm/ADT/Triple.h
+++ include/llvm/ADT/Triple.h
@@ -179,7 +179,8 @@
WatchOS, // Apple watchOS
Mesa3D,
Contiki,
- LastOSType = Contiki
+ AMDPAL, // AMD PAL Runtime
+ LastOSType = AMDPAL
};
enum EnvironmentType {
UnknownEnvironment,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37380.113859.patch
Type: text/x-patch
Size: 1813 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170905/9aeb34fc/attachment-0001.bin>
More information about the llvm-commits
mailing list