[llvm] r364703 - AMDGPU/GlobalISel: Add some more tests for icmp select

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 28 17:55:16 PDT 2019


Author: arsenm
Date: Fri Jun 28 17:55:16 2019
New Revision: 364703

URL: http://llvm.org/viewvc/llvm-project?rev=364703&view=rev
Log:
AMDGPU/GlobalISel: Add some more tests for icmp select

Modified:
    llvm/trunk/test/CodeGen/AMDGPU/GlobalISel/inst-select-icmp.mir

Modified: llvm/trunk/test/CodeGen/AMDGPU/GlobalISel/inst-select-icmp.mir
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AMDGPU/GlobalISel/inst-select-icmp.mir?rev=364703&r1=364702&r2=364703&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/GlobalISel/inst-select-icmp.mir (original)
+++ llvm/trunk/test/CodeGen/AMDGPU/GlobalISel/inst-select-icmp.mir Fri Jun 28 17:55:16 2019
@@ -1,11 +1,12 @@
+# RUN: llc -march=amdgcn -mcpu=tahiti -run-pass=instruction-select -verify-machineinstrs -global-isel %s -o - | FileCheck %s -check-prefixes=GCN
 # RUN: llc -march=amdgcn -mcpu=fiji -run-pass=instruction-select -verify-machineinstrs -global-isel %s -o - | FileCheck %s -check-prefixes=GCN
 
 ---
-name:            icmp_s_mix
+name:            icmp_s32_s_mix
 legalized:       true
 regBankSelected: true
 
-# GCN: name: icmp_s_mix
+# GCN: name: icmp_s32_s_mix
 # GCN: [[SGPR0:%[0-9]+]]:sreg_32 = COPY $sgpr0
 # GCN: [[SGPR1:%[0-9]+]]:sreg_32 = COPY $sgpr1
 # GCN: [[SGPR2:%[0-9]+]]:sreg_32 = COPY $sgpr2
@@ -47,11 +48,11 @@ body: |
 
 ...
 ---
-name:            icmp_salu
+name:            icmp_s32_salu
 legalized:       true
 regBankSelected: true
 
-# GCN-LABEL: name: icmp_salu
+# GCN-LABEL: name: icmp_s32_salu
 # GCN: S_CMP_LG_U32
 # GCN: S_CMP_EQ_U32
 # GCN: S_CMP_GT_I32
@@ -115,11 +116,11 @@ body: |
 
 ...
 ---
-name:            icmp_v_mix
+name:            icmp_s32_v_mix
 legalized:       true
 regBankSelected: true
 
-# GCN-LABEL: name: icmp_v_mix
+# GCN-LABEL: name: icmp_s32_v_mix
 # GCN: [[VGPR2:%[0-9]+]]:vgpr_32 = COPY $vgpr2
 # GCN: [[VGPR3:%[0-9]+]]:vgpr_32 = COPY $vgpr3
 # GCN: [[VGPR4:%[0-9]+]]:vgpr_32 = COPY $vgpr4
@@ -146,19 +147,19 @@ body: |
     %6:vgpr(s32) = COPY $vgpr7
     %7:vgpr(s32) = COPY $vgpr8
     %8:vgpr(s32) = COPY $vgpr9
-    %9:sgpr(s1) = G_ICMP intpred(ne), %1, %2
-    %10:sgpr(s1) = G_ICMP intpred(ne), %5, %6
+    %9:vcc(s1) = G_ICMP intpred(ne), %1, %2
+    %10:vcc(s1) = G_ICMP intpred(ne), %5, %6
     %11:vgpr(s32) = G_SELECT %9, %7, %8
     %12:vgpr(s32) = G_SELECT %10, %3, %4
     G_STORE %11, %0 :: (volatile store 4, addrspace 1)
     G_STORE %12, %0 :: (volatile store 4, addrspace 1)
 ...
 ---
-name:            icmp_valu
+name:            icmp_s32_valu
 legalized:       true
 regBankSelected: true
 
-# GCN-LABEL: name: icmp_valu
+# GCN-LABEL: name: icmp_s32_valu
 # GCN: V_CMP_NE_U32_e64
 # GCN: V_CMP_EQ_U32_e64
 # GCN: V_CMP_GT_I32_e64
@@ -179,16 +180,16 @@ body: |
     %2:vgpr(s32) = COPY $vgpr3
     %3:vgpr(s32) = COPY $vgpr4
     %4:vgpr(s32) = COPY $vgpr5
-    %5:sgpr(s1) = G_ICMP intpred(ne), %1, %2
-    %6:sgpr(s1) = G_ICMP intpred(eq), %1, %2
-    %7:sgpr(s1) = G_ICMP intpred(sgt), %1, %2
-    %8:sgpr(s1) = G_ICMP intpred(sge), %1, %2
-    %9:sgpr(s1) = G_ICMP intpred(slt), %1, %2
-    %10:sgpr(s1) = G_ICMP intpred(sle), %1, %2
-    %11:sgpr(s1) = G_ICMP intpred(ugt), %1, %2
-    %12:sgpr(s1) = G_ICMP intpred(uge), %1, %2
-    %13:sgpr(s1) = G_ICMP intpred(ult), %1, %2
-    %14:sgpr(s1) = G_ICMP intpred(ule), %1, %2
+    %5:vcc(s1) = G_ICMP intpred(ne), %1, %2
+    %6:vcc(s1) = G_ICMP intpred(eq), %1, %2
+    %7:vcc(s1) = G_ICMP intpred(sgt), %1, %2
+    %8:vcc(s1) = G_ICMP intpred(sge), %1, %2
+    %9:vcc(s1) = G_ICMP intpred(slt), %1, %2
+    %10:vcc(s1) = G_ICMP intpred(sle), %1, %2
+    %11:vcc(s1) = G_ICMP intpred(ugt), %1, %2
+    %12:vcc(s1) = G_ICMP intpred(uge), %1, %2
+    %13:vcc(s1) = G_ICMP intpred(ult), %1, %2
+    %14:vcc(s1) = G_ICMP intpred(ule), %1, %2
     %15:vgpr(s32) = G_SELECT %5, %3, %4
     %16:vgpr(s32) = G_SELECT %6, %3, %4
     %17:vgpr(s32) = G_SELECT %7, %3, %4
@@ -212,11 +213,11 @@ body: |
 ...
 ---
 
-name:            icmp_vv
+name:            icmp_s32_vv
 legalized:       true
 regBankSelected: true
 
-# GCN-LABEL: name: icmp_vv
+# GCN-LABEL: name: icmp_s32_vv
 # GCN: [[VGPR2:%[0-9]+]]:vgpr_32 = COPY $vgpr2
 # GCN: [[VGPR3:%[0-9]+]]:vgpr_32 = COPY $vgpr3
 # GCN: V_CMP_NE_U32_e64 [[VGPR2]], [[VGPR3]]
@@ -230,17 +231,17 @@ body: |
     %2:vgpr(s32) = COPY $vgpr3
     %3:vgpr(s32) = COPY $vgpr4
     %4:vgpr(s32) = COPY $vgpr5
-    %5:sgpr(s1) = G_ICMP intpred(ne), %1, %2
+    %5:vcc(s1) = G_ICMP intpred(ne), %1, %2
     %6:vgpr(s32) = G_SELECT %5, %3, %4
     G_STORE %6, %0 :: (store 4, addrspace 1)
 ...
 ---
 
-name:            icmp_vs
+name:            icmp_s32_vs
 legalized:       true
 regBankSelected: true
 
-# GCN-LABEL: name: icmp_vs
+# GCN-LABEL: name: icmp_s32_vs
 # GCN: [[VGPR2:%[0-9]+]]:vgpr_32 = COPY $vgpr2
 # GCN: [[SGPR0:%[0-9]+]]:sreg_32_xm0 = COPY $sgpr0
 # GCN: V_CMP_NE_U32_e64 [[VGPR2]], [[SGPR0]]
@@ -254,17 +255,17 @@ body: |
     %2:vgpr(s32) = COPY $vgpr3
     %3:vgpr(s32) = COPY $vgpr4
     %4:sgpr(s32) = COPY $sgpr0
-    %5:sgpr(s1) = G_ICMP intpred(ne), %1, %4
+    %5:vcc(s1) = G_ICMP intpred(ne), %1, %4
     %6:vgpr(s32) = G_SELECT %5, %2, %3
     G_STORE %6, %0 :: (store 4, addrspace 1)
 ...
 ---
 
-name:            icmp_sv
+name:            icmp_s32_sv
 legalized:       true
 regBankSelected: true
 
-# GCN-LABEL: name: icmp_sv
+# GCN-LABEL: name: icmp_s32_sv
 # GCN: [[VGPR2:%[0-9]+]]:vgpr_32 = COPY $vgpr2
 # GCN: [[SGPR0:%[0-9]+]]:sreg_32_xm0 = COPY $sgpr0
 # GCN: V_CMP_NE_U32_e64 [[SGPR0]], [[VGPR2]]
@@ -278,17 +279,17 @@ body: |
     %2:vgpr(s32) = COPY $vgpr3
     %3:vgpr(s32) = COPY $vgpr4
     %4:sgpr(s32) = COPY $sgpr0
-    %5:sgpr(s1) = G_ICMP intpred(ne), %4, %1
+    %5:vcc(s1) = G_ICMP intpred(ne), %4, %1
     %6:vgpr(s32) = G_SELECT %5, %2, %3
     G_STORE %6, %0 :: (store 4, addrspace 1)
 ...
 ---
 
-name:            icmp_or_vcc
+name:            icmp_s32_or_vcc
 legalized:       true
 regBankSelected: true
 
-# GCN-LABEL: name: icmp_or_vcc
+# GCN-LABEL: name: icmp_s32_or_vcc
 # GCN: [[VGPR2:%[0-9]+]]:vgpr_32 = COPY $vgpr2
 # GCN: [[SGPR0:%[0-9]+]]:sreg_32_xm0 = COPY $sgpr0
 # GCN: V_CMP_NE_U32_e64 [[SGPR0]], [[VGPR2]]
@@ -302,8 +303,55 @@ body: |
     %2:vgpr(s32) = COPY $vgpr3
     %3:vgpr(s32) = COPY $vgpr4
     %4:sgpr(s32) = COPY $sgpr0
-    %5:sgpr(s1) = G_ICMP intpred(ne), %4, %1
+    %5:vcc(s1) = G_ICMP intpred(ne), %4, %1
     %6:vgpr(s32) = G_SELECT %5, %2, %3
     G_STORE %6, %0 :: (store 4, addrspace 1)
 ...
+
 ---
+
+name:            icmp_eq_ne_p3_ss
+legalized:       true
+regBankSelected: true
+
+# GCN-LABEL: name: icmp_eq_ne_p3_ss
+# GCN: S_CMP_EQ_U32 %0, %1, implicit-def $scc
+# GCN: S_CMP_LG_U32 %0, %1, implicit-def $scc
+
+body: |
+  bb.0:
+    liveins:  $sgpr0, $sgpr1
+
+    %0:sgpr(p3) = COPY $sgpr0
+    %1:sgpr(p3) = COPY $sgpr1
+    %2:scc(s1) = G_ICMP intpred(eq), %0, %1
+    %3:scc(s1) = G_ICMP intpred(ne), %0, %1
+    %4:sgpr(s32) = G_SEXT %2
+    %5:sgpr(s32) = G_SEXT %3
+    S_ENDPGM 0, implicit %4, implicit %5
+
+...
+
+---
+
+name:            icmp_eq_ne_p3_vv
+legalized:       true
+regBankSelected: true
+
+# GCN-LABEL: name: icmp_eq_ne_p3_vv
+# GCN: %2:sreg_64_xexec = V_CMP_EQ_U32_e64 %0, %1, implicit $exec
+# GCN: %3:sreg_64_xexec = V_CMP_NE_U32_e64 %0, %1, implicit $exec
+
+body: |
+  bb.0:
+    liveins:  $vgpr0, $vgpr1
+
+    %0:vgpr(p3) = COPY $vgpr0
+    %1:vgpr(p3) = COPY $vgpr1
+    %2:vcc(s1) = G_ICMP intpred(eq), %0, %1
+    %3:vcc(s1) = G_ICMP intpred(ne), %0, %1
+    %4:vgpr(s32) = G_SEXT %2
+    %5:vgpr(s32) = G_SEXT %3
+    S_ENDPGM 0, implicit %4, implicit %5
+
+...




More information about the llvm-commits mailing list