llvm.org GIT mirror llvm / 71f489d
Code clean up. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50675 91177308-0d34-0410-b5e6-96231b3b80d8 Evan Cheng 12 years ago
1 changed file(s) with 25 addition(s) and 24 deletion(s). Raw diff Collapse all Expand all
62136213 MVT::ValueType VT = N->getValueType(0);
62146214 MVT::ValueType EVT = MVT::getVectorElementType(VT);
62156215 SDOperand PermMask = N->getOperand(2);
6216 int NumElems = (int)PermMask.getNumOperands();
6216 unsigned NumElems = PermMask.getNumOperands();
62176217 SDNode *Base = NULL;
6218 for (int i = 0; i < NumElems; ++i) {
6219 SDOperand Idx = PermMask.getOperand(i);
6220 if (Idx.getOpcode() == ISD::UNDEF) {
6221 if (!Base) return SDOperand();
6222 } else {
6223 SDOperand Arg =
6224 getShuffleScalarElt(N, cast(Idx)->getValue(), DAG);
6225 if (!Arg.Val || !ISD::isNON_EXTLoad(Arg.Val))
6218 for (unsigned i = 0; i < NumElems; ++i) {
6219 SDOperand Elt = PermMask.getOperand(i);
6220 if (Elt.getOpcode() == ISD::UNDEF) {
6221 if (!Base)
62266222 return SDOperand();
6227 if (!Base)
6228 Base = Arg.Val;
6229 else if (!isConsecutiveLoad(Arg.Val, Base,
6230 i, MVT::getSizeInBits(EVT)/8,MFI))
6231 return SDOperand();
6232 }
6233 }
6234
6235 bool isAlign16 = isBaseAlignment16(Base->getOperand(1).Val, MFI, Subtarget);
6223 continue;
6224 }
6225
6226 unsigned Idx = cast(Elt)->getValue();
6227 SDOperand Arg = getShuffleScalarElt(N, Idx, DAG);
6228 if (!Arg.Val || !ISD::isNON_EXTLoad(Arg.Val))
6229 return SDOperand();
6230 if (!Base) {
6231 Base = Arg.Val;
6232 continue;
6233 }
6234
6235 if (!isConsecutiveLoad(Arg.Val, Base, i, MVT::getSizeInBits(EVT)/8,MFI))
6236 return SDOperand();
6237 }
6238
62366239 LoadSDNode *LD = cast(Base);
6237 if (isAlign16) {
6240 if (isBaseAlignment16(Base->getOperand(1).Val, MFI, Subtarget))
62386241 return DAG.getLoad(VT, LD->getChain(), LD->getBasePtr(), LD->getSrcValue(),
62396242 LD->getSrcValueOffset(), LD->isVolatile());
6240 } else {
6241 return DAG.getLoad(VT, LD->getChain(), LD->getBasePtr(), LD->getSrcValue(),
6242 LD->getSrcValueOffset(), LD->isVolatile(),
6243 LD->getAlignment());
6244 }
6243 return DAG.getLoad(VT, LD->getChain(), LD->getBasePtr(), LD->getSrcValue(),
6244 LD->getSrcValueOffset(), LD->isVolatile(),
6245 LD->getAlignment());
62456246 }
62466247
62476248 /// PerformSELECTCombine - Do target-specific dag combines on SELECT nodes.