Tabs -> spaces

Use getIntPtrConstant in a couple places to shorten stuff up
Handle splitting vector shuffles with undefs in the mask

llvm-svn: 48351
This commit is contained in:
Nate Begeman 2008-03-14 00:53:31 +00:00
parent 144625ef9b
commit 63eb03f800
1 changed files with 23 additions and 14 deletions

View File

@ -6834,11 +6834,10 @@ void SelectionDAGLegalize::SplitVectorOp(SDOperand Op, SDOperand &Lo,
SDOperand ScalarOp = Node->getOperand(1);
if (Index < NewNumElts_Lo)
Lo = DAG.getNode(ISD::INSERT_VECTOR_ELT, NewVT_Lo, Lo, ScalarOp,
DAG.getConstant(Index, TLI.getPointerTy()));
DAG.getIntPtrConstant(Index));
else
Hi = DAG.getNode(ISD::INSERT_VECTOR_ELT, NewVT_Hi, Hi, ScalarOp,
DAG.getConstant(Index - NewNumElts_Lo,
TLI.getPointerTy()));
DAG.getIntPtrConstant(Index - NewNumElts_Lo));
break;
}
case ISD::VECTOR_SHUFFLE: {
@ -6851,7 +6850,12 @@ void SelectionDAGLegalize::SplitVectorOp(SDOperand Op, SDOperand &Lo,
// buildvector of extractelement here because the input vectors will have
// to be legalized, so this makes the code simpler.
for (unsigned i = 0; i != NewNumElts_Lo; ++i) {
unsigned Idx = cast<ConstantSDNode>(Mask.getOperand(i))->getValue();
SDOperand IdxNode = Mask.getOperand(i);
if (IdxNode.getOpcode() == ISD::UNDEF) {
Ops.push_back(DAG.getNode(ISD::UNDEF, NewEltVT));
continue;
}
unsigned Idx = cast<ConstantSDNode>(IdxNode)->getValue();
SDOperand InVec = Node->getOperand(0);
if (Idx >= NumElements) {
InVec = Node->getOperand(1);
@ -6864,7 +6868,12 @@ void SelectionDAGLegalize::SplitVectorOp(SDOperand Op, SDOperand &Lo,
Ops.clear();
for (unsigned i = NewNumElts_Lo; i != NumElements; ++i) {
unsigned Idx = cast<ConstantSDNode>(Mask.getOperand(i))->getValue();
SDOperand IdxNode = Mask.getOperand(i);
if (IdxNode.getOpcode() == ISD::UNDEF) {
Ops.push_back(DAG.getNode(ISD::UNDEF, NewEltVT));
continue;
}
unsigned Idx = cast<ConstantSDNode>(IdxNode)->getValue();
SDOperand InVec = Node->getOperand(0);
if (Idx >= NumElements) {
InVec = Node->getOperand(1);