summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichel Danzer <michel.daenzer@amd.com>2014-01-28 03:01:16 +0000
committerMichel Danzer <michel.daenzer@amd.com>2014-01-28 03:01:16 +0000
commitf555fb410ed84d8d7cddf61a266cbb7b7c53437e (patch)
tree244d8bbcda86ad550cb750a766a4bab155036182 /test
parent8322c0f305db10a82bbb2589a605f813dbb096b3 (diff)
downloadllvm-f555fb410ed84d8d7cddf61a266cbb7b7c53437e.tar.gz
llvm-f555fb410ed84d8d7cddf61a266cbb7b7c53437e.tar.bz2
llvm-f555fb410ed84d8d7cddf61a266cbb7b7c53437e.tar.xz
R600/SI: Add pattern for truncating i32 to i1
Fixes half a dozen piglit tests with radeonsi. Reviewed-by: Tom Stellard <thomas.stellard@amd.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200283 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/R600/trunc.ll10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/CodeGen/R600/trunc.ll b/test/CodeGen/R600/trunc.ll
index 0bd320ad9c..6bbd7f7b51 100644
--- a/test/CodeGen/R600/trunc.ll
+++ b/test/CodeGen/R600/trunc.ll
@@ -28,3 +28,13 @@ define void @trunc_shl_i64(i32 addrspace(1)* %out, i64 %a) {
store i32 %result, i32 addrspace(1)* %out, align 4
ret void
}
+
+; SI-LABEL: @trunc_i32_to_i1:
+; SI: V_AND_B32
+; SI: V_CMP_EQ_I32
+define void @trunc_i32_to_i1(i32 addrspace(1)* %out, i32 %a) {
+ %trunc = trunc i32 %a to i1
+ %result = select i1 %trunc, i32 1, i32 0
+ store i32 %result, i32 addrspace(1)* %out, align 4
+ ret void
+}