summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorPete Cooper <peter_cooper@apple.com>2012-04-03 22:57:55 +0000
committerPete Cooper <peter_cooper@apple.com>2012-04-03 22:57:55 +0000
commit9511ec86f96399cd852565e61dbc44dc8b26e78f (patch)
treeae803e416ea9c151c1e102f9f6d19b3a37c7eb13 /llvm/test
parentb98934cf72bc190fb8ba1830950a441903220e3f (diff)
downloadbcm5719-llvm-9511ec86f96399cd852565e61dbc44dc8b26e78f.tar.gz
bcm5719-llvm-9511ec86f96399cd852565e61dbc44dc8b26e78f.zip
Add VSELECT to LegalizeVectorTypes::ScalariseVectorResult. Previously it would crash if it encountered a 1 element VSELECT. Solution is slightly more complicated than just creating a SELET as we have to mask or sign extend the vector condition if it had different boolean contents from the scalar condition. Fixes <rdar://problem/11178095>
llvm-svn: 153976
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/Generic/select.ll8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/Generic/select.ll b/llvm/test/CodeGen/Generic/select.ll
index 63052c1a284..77636eb6e61 100644
--- a/llvm/test/CodeGen/Generic/select.ll
+++ b/llvm/test/CodeGen/Generic/select.ll
@@ -185,3 +185,11 @@ define i32 @checkFoldGEP(%Domain* %D, i64 %idx) {
ret i32 %reg820
}
+; Test case for scalarising a 1 element vselect
+;
+define <1 x i32> @checkScalariseVSELECT(<1 x i32> %a, <1 x i32> %b) {
+ %cond = icmp uge <1 x i32> %a, %b
+ %s = select <1 x i1> %cond, <1 x i32> %a, <1 x i32> %b
+ ret <1 x i32> %s
+}
+
OpenPOWER on IntegriCloud