aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2011-03-23 22:16:02 +0000
committerAndrew Trick <atrick@apple.com>2011-03-23 22:16:02 +0000
commitd8fa01fbd7f32e2e1f17c9adb57899baae1d0cfe (patch)
tree15094aef1d5dcfe65cefb572e91563f6f9f67905 /test/CodeGen
parenta8287e322f94ddd66fcb9ae26c4b37e02bd1f796 (diff)
downloadexternal_llvm-d8fa01fbd7f32e2e1f17c9adb57899baae1d0cfe.zip
external_llvm-d8fa01fbd7f32e2e1f17c9adb57899baae1d0cfe.tar.gz
external_llvm-d8fa01fbd7f32e2e1f17c9adb57899baae1d0cfe.tar.bz2
Reapply Eli's r127852 now that the pre-RA scheduler can spill EFLAGS.
(target-specific branchless method for double-width relational comparisons on x86) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128175 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen')
-rw-r--r--test/CodeGen/X86/long-setcc.ll39
-rw-r--r--test/CodeGen/X86/sext-i1.ll3
2 files changed, 30 insertions, 12 deletions
diff --git a/test/CodeGen/X86/long-setcc.ll b/test/CodeGen/X86/long-setcc.ll
index e0165fb..0ab8160 100644
--- a/test/CodeGen/X86/long-setcc.ll
+++ b/test/CodeGen/X86/long-setcc.ll
@@ -1,18 +1,35 @@
-; RUN: llc < %s -march=x86 | grep cmp | count 1
-; RUN: llc < %s -march=x86 | grep shr | count 1
-; RUN: llc < %s -march=x86 | grep xor | count 1
+; RUN: llc < %s -march=x86 | FileCheck %s
-define i1 @t1(i64 %x) nounwind {
- %B = icmp slt i64 %x, 0
- ret i1 %B
+; General case
+define i1 @t1(i64 %x, i64 %y) nounwind {
+; CHECK: @t1
+; CHECK: subl
+; CHECK: sbbl
+; CHECK: setl %al
+ %B = icmp slt i64 %x, %y
+ ret i1 %B
}
+; Some special cases
define i1 @t2(i64 %x) nounwind {
- %tmp = icmp ult i64 %x, 4294967296
- ret i1 %tmp
+; CHECK: @t2
+; CHECK: shrl $31, %eax
+ %B = icmp slt i64 %x, 0
+ ret i1 %B
}
-define i1 @t3(i32 %x) nounwind {
- %tmp = icmp ugt i32 %x, -1
- ret i1 %tmp
+define i1 @t3(i64 %x) nounwind {
+; CHECK: @t3
+; CHECX: cmpl $0
+; CHECX: sete %al
+ %tmp = icmp ult i64 %x, 4294967296
+ ret i1 %tmp
+}
+
+define i1 @t4(i64 %x) nounwind {
+; CHECK: @t4
+; CHECX: cmpl $0
+; CHECX: setne %al
+ %tmp = icmp ugt i64 %x, 4294967295
+ ret i1 %tmp
}
diff --git a/test/CodeGen/X86/sext-i1.ll b/test/CodeGen/X86/sext-i1.ll
index 574769b..2604869 100644
--- a/test/CodeGen/X86/sext-i1.ll
+++ b/test/CodeGen/X86/sext-i1.ll
@@ -39,7 +39,8 @@ entry:
; 32: t3:
; 32: cmpl $1
; 32: sbbl
-; 32: cmpl
+; 32: subl
+; 32: sbbl
; 32: xorl
; 64: t3: