r262123 - AMDGPU: Fix inconsistent register name for flat_scratch

Matt Arsenault via cfe-commits cfe-commits at lists.llvm.org
Sat Feb 27 01:06:23 PST 2016


Author: arsenm
Date: Sat Feb 27 03:06:22 2016
New Revision: 262123

URL: http://llvm.org/viewvc/llvm-project?rev=262123&view=rev
Log:
AMDGPU: Fix inconsistent register name for flat_scratch

Added:
    cfe/trunk/test/CodeGenOpenCL/amdgcn-flat-scratch-name.cl
Modified:
    cfe/trunk/lib/Basic/Targets.cpp

Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=262123&r1=262122&r2=262123&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Sat Feb 27 03:06:22 2016
@@ -2022,8 +2022,8 @@ const char * const AMDGPUTargetInfo::GCC
   "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 {

Added: cfe/trunk/test/CodeGenOpenCL/amdgcn-flat-scratch-name.cl
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenOpenCL/amdgcn-flat-scratch-name.cl?rev=262123&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenOpenCL/amdgcn-flat-scratch-name.cl (added)
+++ cfe/trunk/test/CodeGenOpenCL/amdgcn-flat-scratch-name.cl Sat Feb 27 03:06:22 2016
@@ -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");
+}




More information about the cfe-commits mailing list