AMDGPU/GlobalISel: Select llvm.amdgcn.wqm.vote

This commit is contained in:
Matt Arsenault 2019-09-16 00:53:31 -04:00 committed by Matt Arsenault
parent e130eef588
commit 9150d6bd73
3 changed files with 20 additions and 8 deletions

View File

@ -170,14 +170,14 @@ let Defs = [SCC] in {
let WaveSizePredicate = isWave32 in {
def : GCNPat <
(int_amdgcn_wqm_vote i1:$src0),
(S_WQM_B32 $src0)
(S_WQM_B32 SSrc_b32:$src0)
>;
}
let WaveSizePredicate = isWave64 in {
def : GCNPat <
(int_amdgcn_wqm_vote i1:$src0),
(S_WQM_B64 $src0)
(S_WQM_B64 SSrc_b64:$src0)
>;
}

View File

@ -0,0 +1,3 @@
; Runs original SDAG test with -global-isel
; RUN: llc -global-isel -march=amdgcn -mcpu=tonga -verify-machineinstrs < %S/../llvm.amdgcn.wqm.vote.ll | FileCheck -enable-var-scope -check-prefixes=CHECK,WAVE64 %S/../llvm.amdgcn.wqm.vote.ll
; RUN: llc -global-isel -march=amdgcn -mcpu=gfx1010 -verify-machineinstrs < %S/../llvm.amdgcn.wqm.vote.ll | FileCheck -enable-var-scope -check-prefixes=CHECK,WAVE32 %S/../llvm.amdgcn.wqm.vote.ll

View File

@ -1,8 +1,10 @@
; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefix=CHECK %s
; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefixes=CHECK,WAVE64 %s
; RUN: llc -march=amdgcn -mcpu=gfx1010 -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefixes=CHECK,WAVE32 %s
;CHECK-LABEL: {{^}}ret:
;CHECK: v_cmp_eq_u32_e32 [[CMP:[^,]+]], v0, v1
;CHECK: s_wqm_b64 [[WQM:[^,]+]], [[CMP]]
;WAVE64: s_wqm_b64 [[WQM:[^,]+]], [[CMP]]
;WAVE32: s_wqm_b32 [[WQM:[^,]+]], [[CMP]]
;CHECK: v_cndmask_b32_e64 v0, 0, 1.0, [[WQM]]
define amdgpu_ps float @ret(i32 %v0, i32 %v1) #1 {
main_body:
@ -13,7 +15,8 @@ main_body:
}
;CHECK-LABEL: {{^}}true:
;CHECK: s_wqm_b64
;WAVE64: s_wqm_b64
;WAVE32: s_wqm_b32
define amdgpu_ps float @true() #1 {
main_body:
%w = call i1 @llvm.amdgcn.wqm.vote(i1 true)
@ -22,7 +25,8 @@ main_body:
}
;CHECK-LABEL: {{^}}false:
;CHECK: s_wqm_b64
;WAVE64: s_wqm_b64
;WAVE32: s_wqm_b32
define amdgpu_ps float @false() #1 {
main_body:
%w = call i1 @llvm.amdgcn.wqm.vote(i1 false)
@ -32,8 +36,13 @@ main_body:
;CHECK-LABEL: {{^}}kill:
;CHECK: v_cmp_eq_u32_e32 [[CMP:[^,]+]], v0, v1
;CHECK: s_wqm_b64 [[WQM:[^,]+]], [[CMP]]
;CHECK: s_and_b64 exec, exec, [[WQM]]
;WAVE64: s_wqm_b64 [[WQM:[^,]+]], [[CMP]]
;WAVE64: s_and_b64 exec, exec, [[WQM]]
;WAVE32: s_wqm_b32 [[WQM:[^,]+]], [[CMP]]
;WAVE32: s_and_b32 exec_lo, exec_lo, [[WQM]]
;CHECK: s_endpgm
define amdgpu_ps void @kill(i32 %v0, i32 %v1) #1 {
main_body: