[PATCH] D17520: AMDGPU: Fix inconsistent register name for flat_scratch
Matt Arsenault via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 22 12:44:29 PST 2016
arsenm created this revision.
arsenm added a reviewer: tstellarAMD.
arsenm added a subscriber: cfe-commits.
http://reviews.llvm.org/D17520
Files:
lib/Basic/Targets.cpp
test/CodeGenOpenCL/amdgcn-flat-scratch-name.cl
Index: test/CodeGenOpenCL/amdgcn-flat-scratch-name.cl
===================================================================
--- /dev/null
+++ test/CodeGenOpenCL/amdgcn-flat-scratch-name.cl
@@ -0,0 +1,15 @@
+// REQUIRES: amdgpu-registered-target
+// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -S -emit-llvm -o - %s | FileCheck %s
+
+// CHECK-LABEL: @use_flat_scratch_name
+kernel void use_flat_scratch_name()
+{
+// CHECK: tail call void asm sideeffect "s_mov_b64 flat_scratch, 0", "~{flat_scratch}"()
+ __asm__ volatile("s_mov_b64 flat_scratch, 0" : : : "flat_scratch");
+
+// CHECK: tail call void asm sideeffect "s_mov_b32 flat_scratch_lo, 0", "~{flat_scratch_lo}"()
+ __asm__ volatile("s_mov_b32 flat_scratch_lo, 0" : : : "flat_scratch_lo");
+
+// CHECK: tail call void asm sideeffect "s_mov_b32 flat_scratch_hi, 0", "~{flat_scratch_hi}"()
+ __asm__ volatile("s_mov_b32 flat_scratch_hi, 0" : : : "flat_scratch_hi");
+}
Index: lib/Basic/Targets.cpp
===================================================================
--- lib/Basic/Targets.cpp
+++ lib/Basic/Targets.cpp
@@ -2047,8 +2047,8 @@
"s104", "s105", "s106", "s107", "s108", "s109", "s110", "s111",
"s112", "s113", "s114", "s115", "s116", "s117", "s118", "s119",
"s120", "s121", "s122", "s123", "s124", "s125", "s126", "s127"
- "exec", "vcc", "scc", "m0", "flat_scr", "exec_lo", "exec_hi",
- "vcc_lo", "vcc_hi", "flat_scr_lo", "flat_scr_hi"
+ "exec", "vcc", "scc", "m0", "flat_scratch", "exec_lo", "exec_hi",
+ "vcc_lo", "vcc_hi", "flat_scratch_lo", "flat_scratch_hi"
};
ArrayRef<const char *> AMDGPUTargetInfo::getGCCRegNames() const {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17520.48719.patch
Type: text/x-patch
Size: 1617 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160222/4d4713d9/attachment.bin>
More information about the cfe-commits
mailing list