[llvm-commits] [llvm] r41164 - /llvm/trunk/test/CodeGen/X86/select-zero-one.ll
Evan Cheng
evan.cheng at apple.com
Fri Aug 17 23:11:58 PDT 2007
Author: evancheng
Date: Sat Aug 18 01:11:57 2007
New Revision: 41164
URL: http://llvm.org/viewvc/llvm-project?rev=41164&view=rev
Log:
Test dag xform: Fold C ? 0 : 1 to ~C or zext(~C) or trunc(~C)
Added:
llvm/trunk/test/CodeGen/X86/select-zero-one.ll
Added: llvm/trunk/test/CodeGen/X86/select-zero-one.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/select-zero-one.ll?rev=41164&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/select-zero-one.ll (added)
+++ llvm/trunk/test/CodeGen/X86/select-zero-one.ll Sat Aug 18 01:11:57 2007
@@ -0,0 +1,25 @@
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | not grep cmov
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | not grep xor
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movzbl | count 1
+
+ at r1 = weak global i32 0
+
+define void @t1(i32 %a, double %b) {
+ %tmp114 = fcmp ugt double %b, 1.000000e-09
+ %tmp120 = icmp eq i32 %a, 0 ; <i1> [#uses=1]
+ %bothcond = or i1 %tmp114, %tmp120 ; <i1> [#uses=1]
+ %storemerge = select i1 %bothcond, i32 0, i32 1 ; <i32> [#uses=2]
+ store i32 %storemerge, i32* @r1, align 4
+ ret void
+}
+
+ at r2 = weak global i8 0
+
+define void @t2(i32 %a, double %b) {
+ %tmp114 = fcmp ugt double %b, 1.000000e-09
+ %tmp120 = icmp eq i32 %a, 0 ; <i1> [#uses=1]
+ %bothcond = or i1 %tmp114, %tmp120 ; <i1> [#uses=1]
+ %storemerge = select i1 %bothcond, i8 0, i8 1 ; <i32> [#uses=2]
+ store i8 %storemerge, i8* @r2, align 4
+ ret void
+}
More information about the llvm-commits
mailing list