summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorNadav Rotem <nadav.rotem@intel.com>2012-06-07 20:28:57 +0000
committerNadav Rotem <nadav.rotem@intel.com>2012-06-07 20:28:57 +0000
commit4e50efead611a59e808f7744132c3ad1576cc404 (patch)
tree34f1d69ebd325bf6107e1a57ce60187ddcb82dc5 /llvm/test
parenta7dcc996a980d29fa7fb7536d0f3f48e572b1ca9 (diff)
downloadbcm5719-llvm-4e50efead611a59e808f7744132c3ad1576cc404.tar.gz
bcm5719-llvm-4e50efead611a59e808f7744132c3ad1576cc404.zip
Fix a bug in FoldSelectOpOp. Bitcast ops may change the number of vector elements, which may disagree with the select condition type.
llvm-svn: 158166
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Transforms/InstCombine/2012-6-7-vselect-bitcast.ll11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/2012-6-7-vselect-bitcast.ll b/llvm/test/Transforms/InstCombine/2012-6-7-vselect-bitcast.ll
new file mode 100644
index 00000000000..cb527f86406
--- /dev/null
+++ b/llvm/test/Transforms/InstCombine/2012-6-7-vselect-bitcast.ll
@@ -0,0 +1,11 @@
+; RUN: opt < %s -instcombine -S | FileCheck %s
+; CHECK: bitcast
+
+define void @foo(<16 x i8> %a, <16 x i8> %b, <4 x i32>* %c) {
+ %aa = bitcast <16 x i8> %a to <4 x i32>
+ %bb = bitcast <16 x i8> %b to <4 x i32>
+ %select_v = select <4 x i1> zeroinitializer, <4 x i32> %aa, <4 x i32> %bb
+ store <4 x i32> %select_v, <4 x i32>* %c, align 4
+ ret void
+}
+
OpenPOWER on IntegriCloud