llvm.org GIT mirror llvm / 5589a69
Fix a crash in the legalization of large vectors. When truncating a result of a vector that is split we need to use the result of the split vector, and not re-split the dead node. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160357 91177308-0d34-0410-b5e6-96231b3b80d8 Nadav Rotem 7 years ago
2 changed file(s) with 19 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
591591 assert(isPowerOf2_32(NumElts) &&
592592 "Promoted vector type must be a power of two");
593593
594 EVT HalfVT = EVT::getVectorVT(*DAG.getContext(), EltVT, NumElts/2);
594 SDValue EOp1, EOp2;
595 GetSplitVector(InOp, EOp1, EOp2);
596
595597 EVT HalfNVT = EVT::getVectorVT(*DAG.getContext(), NVT.getScalarType(),
596598 NumElts/2);
597
598 SDValue EOp1 = DAG.getNode(ISD::EXTRACT_SUBVECTOR, dl, HalfVT, InOp,
599 DAG.getIntPtrConstant(0));
600 SDValue EOp2 = DAG.getNode(ISD::EXTRACT_SUBVECTOR, dl, HalfVT, InOp,
601 DAG.getIntPtrConstant(NumElts/2));
602599 EOp1 = DAG.getNode(ISD::TRUNCATE, dl, HalfNVT, EOp1);
603600 EOp2 = DAG.getNode(ISD::TRUNCATE, dl, HalfNVT, EOp2);
604601
0 ; RUN: llc < %s -march=x86-64 -mcpu=corei7
1
2 define void @autogen_SD33189483() {
3 BB:
4 br label %CF76
5
6 CF76: ; preds = %CF76, %BB
7 %Shuff13 = shufflevector <4 x i64> zeroinitializer, <4 x i64> undef, <4 x i32> zeroinitializer
8 %Tr16 = trunc <8 x i64> to <8 x i1>
9 %E19 = extractelement <8 x i1> %Tr16, i32 2
10 br i1 %E19, label %CF76, label %CF78
11
12 CF78: ; preds = %CF78, %CF76
13 %BC = bitcast <4 x i64> %Shuff13 to <4 x double>
14 br label %CF78
15 }