aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2010-01-07 00:54:06 +0000
committerEvan Cheng <evan.cheng@apple.com>2010-01-07 00:54:06 +0000
commit17751dac3e0a7b7a8cdf9bd612ce20f157eb251f (patch)
tree9e9dba3cf9cd9e1598aff628c3e58bf39cce0726 /test
parentad6b6da8aafa88fa3bd002f2595121e1227c4b93 (diff)
downloadexternal_llvm-17751dac3e0a7b7a8cdf9bd612ce20f157eb251f.zip
external_llvm-17751dac3e0a7b7a8cdf9bd612ce20f157eb251f.tar.gz
external_llvm-17751dac3e0a7b7a8cdf9bd612ce20f157eb251f.tar.bz2
Fix a minor regression from my dag combiner changes. One more place which needs to look pass truncates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92885 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/X86/and-su.ll43
1 files changed, 40 insertions, 3 deletions
diff --git a/test/CodeGen/X86/and-su.ll b/test/CodeGen/X86/and-su.ll
index b5ac23b..38db88a 100644
--- a/test/CodeGen/X86/and-su.ll
+++ b/test/CodeGen/X86/and-su.ll
@@ -1,16 +1,53 @@
-; RUN: llc < %s -march=x86 | grep {(%} | count 1
+; RUN: llc < %s -march=x86 | FileCheck %s
; Don't duplicate the load.
define fastcc i32 @foo(i32* %p) nounwind {
+; CHECK: foo:
+; CHECK: andl $10, %eax
+; CHECK: je
%t0 = load i32* %p
%t2 = and i32 %t0, 10
%t3 = icmp ne i32 %t2, 0
br i1 %t3, label %bb63, label %bb76
-
bb63:
ret i32 %t2
-
bb76:
ret i32 0
}
+
+define fastcc double @bar(i32 %hash, double %x, double %y) nounwind {
+entry:
+; CHECK: bar:
+ %0 = and i32 %hash, 15
+ %1 = icmp ult i32 %0, 8
+ br i1 %1, label %bb11, label %bb10
+
+bb10:
+; CHECK: bb10
+; CHECK: testb $1
+ %2 = and i32 %hash, 1
+ %3 = icmp eq i32 %2, 0
+ br i1 %3, label %bb13, label %bb11
+
+bb11:
+ %4 = fsub double -0.000000e+00, %x
+ br label %bb13
+
+bb13:
+; CHECK: bb13
+; CHECK: testb $2
+ %iftmp.9.0 = phi double [ %4, %bb11 ], [ %x, %bb10 ]
+ %5 = and i32 %hash, 2
+ %6 = icmp eq i32 %5, 0
+ br i1 %6, label %bb16, label %bb14
+
+bb14:
+ %7 = fsub double -0.000000e+00, %y
+ br label %bb16
+
+bb16:
+ %iftmp.10.0 = phi double [ %7, %bb14 ], [ %y, %bb13 ]
+ %8 = fadd double %iftmp.9.0, %iftmp.10.0
+ ret double %8
+}