llvm.org GIT mirror llvm / 819026f
Fix a bug in the type-legalization of vector integers. When we bitcast one vector type to another, we must not bitcast the result if one type is widened while the other is promoted. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148383 91177308-0d34-0410-b5e6-96231b3b80d8 Nadav Rotem 8 years ago
2 changed file(s) with 18 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
248248 return DAG.getNode(ISD::BITCAST, dl, NOutVT, InOp);
249249 }
250250 case TargetLowering::TypeWidenVector:
251 if (NOutVT.bitsEq(NInVT))
252 // The input is widened to the same size. Convert to the widened value.
251 // The input is widened to the same size. Convert to the widened value.
252 // Make sure that the outgoing value is not a vector, because this would
253 // make us bitcast between two vectors which are legalized in different ways.
254 if (NOutVT.bitsEq(NInVT) && !NOutVT.isVector())
253255 return DAG.getNode(ISD::BITCAST, dl, NOutVT, GetWidenedVector(InOp));
254256 }
255257
0 ; RUN: llc < %s -march=x86-64 -mcpu=corei7 -mtriple=x86_64-pc-win32 | FileCheck %s
1
2 ;CHECK: vcast
3 define <2 x i32> @vcast(<2 x float> %a, <2 x float> %b) {
4 ;CHECK: pshufd
5 ;CHECK: pshufd
6 %af = bitcast <2 x float> %a to <2 x i32>
7 %bf = bitcast <2 x float> %b to <2 x i32>
8 %x = sub <2 x i32> %af, %bf
9 ;CHECK: psubq
10 ret <2 x i32> %x
11 ;CHECK: ret
12 }
13