summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/select.ll
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-03-30 22:37:04 +0000
committerChris Lattner <sabre@nondot.org>2004-03-30 22:37:04 +0000
commitdd285eab682ff05b537218690d4d399017d062f4 (patch)
tree5e43ad8bc7efd59662f94f8654d19ff41b6dd34d /test/CodeGen/X86/select.ll
parent5192676aa48dca878f035c20ddc03d7e3cbeb03b (diff)
downloadllvm-dd285eab682ff05b537218690d4d399017d062f4.tar.gz
llvm-dd285eab682ff05b537218690d4d399017d062f4.tar.bz2
llvm-dd285eab682ff05b537218690d4d399017d062f4.tar.xz
Test folding comparisons into select instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12559 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/select.ll')
-rw-r--r--test/CodeGen/X86/select.ll18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/CodeGen/X86/select.ll b/test/CodeGen/X86/select.ll
index 6259bebdac..1be5261eb6 100644
--- a/test/CodeGen/X86/select.ll
+++ b/test/CodeGen/X86/select.ll
@@ -30,3 +30,21 @@ double %doubleSel(bool %A, double %B, double %C) {
ret double %X
}
+sbyte %foldSel(bool %A, sbyte %B, sbyte %C) {
+ %Cond = setlt sbyte %B, %C
+ %X = select bool %Cond, sbyte %B, sbyte %C
+ ret sbyte %X
+}
+
+int %foldSel2(bool %A, int %B, int %C) {
+ %Cond = seteq int %B, %C
+ %X = select bool %Cond, int %B, int %C
+ ret int %X
+}
+
+int %foldSel2(bool %A, int %B, int %C, double %X, double %Y) {
+ %Cond = setlt double %X, %Y
+ %X = select bool %Cond, int %B, int %C
+ ret int %X
+}
+