[llvm] r238999 - R600: Re-enable sub-reg liveness

Tom Stellard thomas.stellard at amd.com
Wed Jun 3 18:20:04 PDT 2015


Author: tstellar
Date: Wed Jun  3 20:20:04 2015
New Revision: 238999

URL: http://llvm.org/viewvc/llvm-project?rev=238999&view=rev
Log:
R600: Re-enable sub-reg liveness

The bug in the R600 backend that this uncovered has been fixed.

Modified:
    llvm/trunk/lib/Target/R600/AMDGPUSubtarget.h
    llvm/trunk/test/CodeGen/R600/coalescer_remat.ll
    llvm/trunk/test/CodeGen/R600/imm.ll
    llvm/trunk/test/CodeGen/R600/subreg-eliminate-dead.ll

Modified: llvm/trunk/lib/Target/R600/AMDGPUSubtarget.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/AMDGPUSubtarget.h?rev=238999&r1=238998&r2=238999&view=diff
==============================================================================
--- llvm/trunk/lib/Target/R600/AMDGPUSubtarget.h (original)
+++ llvm/trunk/lib/Target/R600/AMDGPUSubtarget.h Wed Jun  3 20:20:04 2015
@@ -272,7 +272,7 @@ public:
   }
 
   bool enableSubRegLiveness() const override {
-    return false;
+    return true;
   }
 };
 

Modified: llvm/trunk/test/CodeGen/R600/coalescer_remat.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/R600/coalescer_remat.ll?rev=238999&r1=238998&r2=238999&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/R600/coalescer_remat.ll (original)
+++ llvm/trunk/test/CodeGen/R600/coalescer_remat.ll Wed Jun  3 20:20:04 2015
@@ -11,7 +11,8 @@ declare float @llvm.fma.f32(float, float
 ; CHECK:  v_mov_b32_e32 v{{[0-9]+}}, 0
 ; CHECK:  v_mov_b32_e32 v{{[0-9]+}}, 0
 ; CHECK:  v_mov_b32_e32 v{{[0-9]+}}, 0
-; CHECK: ; NumVgprs: 12
+; It's probably OK if this is slightly higher:
+; CHECK: ; NumVgprs: 9
 define void @foobar(<4 x float> addrspace(1)* %out, <4 x float> addrspace(1)* %in, i32 %flag) {
 entry:
   %cmpflag = icmp eq i32 %flag, 1

Modified: llvm/trunk/test/CodeGen/R600/imm.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/R600/imm.ll?rev=238999&r1=238998&r2=238999&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/R600/imm.ll (original)
+++ llvm/trunk/test/CodeGen/R600/imm.ll Wed Jun  3 20:20:04 2015
@@ -36,7 +36,7 @@ define void @store_imm_neg_0.0_i64(i64 a
 
 ; CHECK-LABEL: {{^}}store_inline_imm_neg_0.0_i32:
 ; CHECK: v_mov_b32_e32 [[REG:v[0-9]+]], 0x80000000
-; CHECK-NEXT: buffer_store_dword [[REG]]
+; CHECK: buffer_store_dword [[REG]]
 define void @store_inline_imm_neg_0.0_i32(i32 addrspace(1)* %out) {
   store i32 -2147483648, i32 addrspace(1)* %out
   ret void

Modified: llvm/trunk/test/CodeGen/R600/subreg-eliminate-dead.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/R600/subreg-eliminate-dead.ll?rev=238999&r1=238998&r2=238999&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/R600/subreg-eliminate-dead.ll (original)
+++ llvm/trunk/test/CodeGen/R600/subreg-eliminate-dead.ll Wed Jun  3 20:20:04 2015
@@ -2,43 +2,9 @@
 ; LiveRangeEdit::eliminateDeadDef did not update LiveInterval sub ranges
 ; properly.
 
+; Just make sure this test doesn't crash.
 ; CHECK-LABEL: foobar:
-; Output with subregister liveness disabled:
-; CHECK: v_mov_b32_e32 v1, 1
-; CHECK: v_mov_b32_e32 v0, 0
-; CHECK: v_cmp_eq_i32_e32 vcc, s0, v0
-; CHECK: v_cmp_eq_i32_e64 s[0:1], s0, v1
-; CHECK: v_mov_b32_e32 v1, 3
-; CHECK: v_mov_b32_e32 v0, 2
-; CHECK: v_cmp_eq_i32_e64 s[2:3], s0, v0
-; CHECK: v_cmp_eq_i32_e64 s[4:5], s0, v1
-; CHECK: v_cndmask_b32_e64 v3, 0, -1, s[4:5]
-; CHECK: v_cndmask_b32_e64 v2, 0, -1, s[2:3]
-; CHECK: v_cndmask_b32_e64 v1, 0, -1, s[0:1]
-; CHECK: v_cndmask_b32_e64 v0, 0, -1, vcc
-; CHECK: v_cmp_ne_i32_e32 vcc, 0, v1
-; CHECK: v_cndmask_b32_e64 v1, 0, v0, vcc
-; CHECK: s_mov_b32 s3, 0xf000
-; CHECK: s_mov_b32 s2, -1
-; CHECK: buffer_store_dwordx2 v[0:1], s[0:3], 0
 ; CHECK: s_endpgm
-; Output with subregister liveness enabled:
-; XCHECK: v_mov_b32_e32 v1, 1
-; XCHECK: v_mov_b32_e32 v0, 0
-; XCHECK: v_cmp_eq_i32_e32 vcc, s0, v1
-; XCHECK: v_mov_b32_e32 v1, 3
-; XCHECK: v_mov_b32_e32 v0, 2
-; XCHECK: v_cmp_eq_i32_e64 s[0:1], s0, v0
-; XCHECK: v_cmp_eq_i32_e64 s[2:3], s0, v1
-; XCHECK: v_cndmask_b32_e64 v3, 0, -1, s[2:3]
-; XCHECK: v_cndmask_b32_e64 v2, 0, -1, s[0:1]
-; XCHECK: v_cndmask_b32_e64 v1, 0, -1, vcc
-; XCHECK: v_cmp_ne_i32_e32 vcc, 0, v1
-; XCHECK: v_cndmask_b32_e64 v1, 0, v0, vcc
-; XCHECK: s_mov_b32 s3, 0xf000
-; XCHECK: s_mov_b32 s2, -1
-; XCHECK: buffer_store_dwordx2 v[0:1], s[0:3], 0
-; XCHECK: s_endpgm
 define void @foobar() {
   %v0 = icmp eq <4 x i32> undef, <i32 0, i32 1, i32 2, i32 3>
   %v3 = sext <4 x i1> %v0 to <4 x i32>





More information about the llvm-commits mailing list