summaryrefslogtreecommitdiff
path: root/test/CodeGen/Generic
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
commit2ce63c73520cd6e715f9114589f802938b5db01f (patch)
tree894de6caa1343d4b049aeb841d4fd30133fe15a3 /test/CodeGen/Generic
parentdda3a099a096588d435fdb855b52b0a203316de2 (diff)
downloadllvm-2ce63c73520cd6e715f9114589f802938b5db01f.tar.gz
llvm-2ce63c73520cd6e715f9114589f802938b5db01f.tar.bz2
llvm-2ce63c73520cd6e715f9114589f802938b5db01f.tar.xz
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>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153976 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/Generic')
-rw-r--r--test/CodeGen/Generic/select.ll8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/CodeGen/Generic/select.ll b/test/CodeGen/Generic/select.ll
index 63052c1a28..77636eb6e6 100644
--- a/test/CodeGen/Generic/select.ll
+++ b/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
+}
+