summaryrefslogtreecommitdiff
path: root/test/CodeGen
diff options
context:
space:
mode:
authorMichel Danzer <michel.daenzer@amd.com>2014-02-27 01:47:09 +0000
committerMichel Danzer <michel.daenzer@amd.com>2014-02-27 01:47:09 +0000
commit644aecfc973e6b899230a3c7eb7541c948e69522 (patch)
tree3e540e03f1a4a7d908d296b4e6fb08607ae592e3 /test/CodeGen
parenta5fbf2471688af979966da0d540875ec43308b07 (diff)
downloadllvm-644aecfc973e6b899230a3c7eb7541c948e69522.tar.gz
llvm-644aecfc973e6b899230a3c7eb7541c948e69522.tar.bz2
llvm-644aecfc973e6b899230a3c7eb7541c948e69522.tar.xz
R600/SI: Optimize SI_KILL for constant operands
If the SI_KILL operand is constant, we can either clear the exec mask if the operand is negative, or do nothing otherwise. Reviewed-by: Tom Stellard <thomas.stellard@amd.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202337 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen')
-rw-r--r--test/CodeGen/R600/llvm.AMDGPU.kill.ll10
1 files changed, 7 insertions, 3 deletions
diff --git a/test/CodeGen/R600/llvm.AMDGPU.kill.ll b/test/CodeGen/R600/llvm.AMDGPU.kill.ll
index bec5cdf65f..4ab6a8ae09 100644
--- a/test/CodeGen/R600/llvm.AMDGPU.kill.ll
+++ b/test/CodeGen/R600/llvm.AMDGPU.kill.ll
@@ -1,13 +1,17 @@
; RUN: llc < %s -march=r600 -mcpu=verde -verify-machineinstrs | FileCheck --check-prefix=SI %s
-; SI-LABEL: @kill_gs
-; SI: V_CMPX_LE_F32
+; SI-LABEL: @kill_gs_const
+; SI-NOT: V_CMPX_LE_F32
+; SI: S_MOV_B64 exec, 0
-define void @kill_gs() #0 {
+define void @kill_gs_const() #0 {
main_body:
%0 = icmp ule i32 0, 3
%1 = select i1 %0, float 1.000000e+00, float -1.000000e+00
call void @llvm.AMDGPU.kill(float %1)
+ %2 = icmp ule i32 3, 0
+ %3 = select i1 %2, float 1.000000e+00, float -1.000000e+00
+ call void @llvm.AMDGPU.kill(float %3)
ret void
}