summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/Generic
diff options
context:
space:
mode:
authorNadav Rotem <nadav.rotem@intel.com>2011-06-01 12:51:46 +0000
committerNadav Rotem <nadav.rotem@intel.com>2011-06-01 12:51:46 +0000
commit8b24a731f2740445a1e0faac56814270bd40ebf8 (patch)
tree2f631a37b60c6be59b60d3310bd87d1b81cf2f55 /llvm/test/CodeGen/Generic
parent9ed423b504f2b82bfcebf7570ec131a6dedd7fb8 (diff)
downloadbcm5719-llvm-8b24a731f2740445a1e0faac56814270bd40ebf8.tar.gz
bcm5719-llvm-8b24a731f2740445a1e0faac56814270bd40ebf8.zip
This patch is another step in the direction of adding vector select. In this
patch we add a flag to enable a new type legalization decision - to promote integer elements in vectors. Currently, the rest of the codegen does not support this kind of legalization. This flag will be removed when the transition is complete. llvm-svn: 132394
Diffstat (limited to 'llvm/test/CodeGen/Generic')
-rw-r--r--llvm/test/CodeGen/Generic/promote-integers.ll15
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/Generic/promote-integers.ll b/llvm/test/CodeGen/Generic/promote-integers.ll
new file mode 100644
index 00000000000..58125921b39
--- /dev/null
+++ b/llvm/test/CodeGen/Generic/promote-integers.ll
@@ -0,0 +1,15 @@
+; Test that vectors are scalarized/lowered correctly.
+; RUN: llc -march=x86 -promote-elements < %s | FileCheck %s
+
+; This test is the poster-child for integer-element-promotion.
+; Until this feature is complete, we mark this test as expected to fail.
+; XFAIL: *
+; CHECK: vector_code
+; CHECK: ret
+define <4 x float> @vector_code(<4 x i64> %A, <4 x i64> %B, <4 x float> %R0, <4 x float> %R1 ) {
+ %C = icmp eq <4 x i64> %A, %B
+ %K = xor <4 x i1> <i1 1, i1 1, i1 1, i1 1>, %C
+ %D = select <4 x i1> %K, <4 x float> %R1, <4 x float> %R0
+ ret <4 x float> %D
+}
+
OpenPOWER on IntegriCloud