From d84d35ba70296aca01d3c48ab9088b0515619fd9 Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Thu, 15 Feb 2007 02:26:10 +0000 Subject: For PR1195: Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and PackedTyID -> VectorTyID. No functional changes. llvm-svn: 34293 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 58 +++++++++++----------- 1 file changed, 29 insertions(+), 29 deletions(-) (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp') diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 909dc68f083..a156bda9750 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -281,7 +281,7 @@ FunctionLoweringInfo::FunctionLoweringInfo(TargetLowering &tli, else { MVT::ValueType VT1,VT2; NumElements = - TLI.getPackedTypeBreakdown(cast(PN->getType()), + TLI.getVectorTypeBreakdown(cast(PN->getType()), VT1, VT2); } unsigned PHIReg = ValueMap[PN]; @@ -306,7 +306,7 @@ unsigned FunctionLoweringInfo::CreateRegForValue(const Value *V) { // If this is a packed type, figure out what type it will decompose into // and how many of the elements it will use. if (VT == MVT::Vector) { - const PackedType *PTy = cast(V->getType()); + const VectorType *PTy = cast(V->getType()); unsigned NumElts = PTy->getNumElements(); MVT::ValueType EltTy = TLI.getValueType(PTy->getElementType()); @@ -504,7 +504,7 @@ public: void visitEitherBinary(User &I, unsigned ScalarOp, unsigned VectorOp); void visitShift(User &I, unsigned Opcode); void visitAdd(User &I) { - if (isa(I.getType())) + if (isa(I.getType())) visitVectorBinary(I, ISD::VADD); else if (I.getType()->isFloatingPoint()) visitScalarBinary(I, ISD::FADD); @@ -513,7 +513,7 @@ public: } void visitSub(User &I); void visitMul(User &I) { - if (isa(I.getType())) + if (isa(I.getType())) visitVectorBinary(I, ISD::VMUL); else if (I.getType()->isFloatingPoint()) visitScalarBinary(I, ISD::FMUL); @@ -601,11 +601,11 @@ SDOperand SelectionDAGLowering::getValue(const Value *V) { } else if (isa(C)) { return N = DAG.getConstant(0, TLI.getPointerTy()); } else if (isa(C)) { - if (!isa(VTy)) + if (!isa(VTy)) return N = DAG.getNode(ISD::UNDEF, VT); // Create a VBUILD_VECTOR of undef nodes. - const PackedType *PTy = cast(VTy); + const VectorType *PTy = cast(VTy); unsigned NumElements = PTy->getNumElements(); MVT::ValueType PVT = TLI.getValueType(PTy->getElementType()); @@ -619,7 +619,7 @@ SDOperand SelectionDAGLowering::getValue(const Value *V) { &Ops[0], Ops.size()); } else if (ConstantFP *CFP = dyn_cast(C)) { return N = DAG.getConstantFP(CFP->getValue(), VT); - } else if (const PackedType *PTy = dyn_cast(VTy)) { + } else if (const VectorType *PTy = dyn_cast(VTy)) { unsigned NumElements = PTy->getNumElements(); MVT::ValueType PVT = TLI.getValueType(PTy->getElementType()); @@ -627,7 +627,7 @@ SDOperand SelectionDAGLowering::getValue(const Value *V) { // Constant or ConstantFP node onto the ops list for each element of // the packed constant. SmallVector Ops; - if (ConstantPacked *CP = dyn_cast(C)) { + if (ConstantVector *CP = dyn_cast(C)) { for (unsigned i = 0; i != NumElements; ++i) Ops.push_back(getValue(CP->getOperand(i))); } else { @@ -691,8 +691,8 @@ SDOperand SelectionDAGLowering::getValue(const Value *V) { // Otherwise, if this is a vector, make it available as a generic vector // here. MVT::ValueType PTyElementVT, PTyLegalElementVT; - const PackedType *PTy = cast(VTy); - unsigned NE = TLI.getPackedTypeBreakdown(PTy, PTyElementVT, + const VectorType *PTy = cast(VTy); + unsigned NE = TLI.getVectorTypeBreakdown(PTy, PTyElementVT, PTyLegalElementVT); // Build a VBUILD_VECTOR with the input registers. @@ -1377,7 +1377,7 @@ void SelectionDAGLowering::visitSwitch(SwitchInst &I) { void SelectionDAGLowering::visitSub(User &I) { // -0.0 - X --> fneg const Type *Ty = I.getType(); - if (isa(Ty)) { + if (isa(Ty)) { visitVectorBinary(I, ISD::VSUB); } else if (Ty->isFloatingPoint()) { if (ConstantFP *CFP = dyn_cast(I.getOperand(0))) @@ -1400,8 +1400,8 @@ void SelectionDAGLowering::visitScalarBinary(User &I, unsigned OpCode) { void SelectionDAGLowering::visitVectorBinary(User &I, unsigned OpCode) { - assert(isa(I.getType())); - const PackedType *Ty = cast(I.getType()); + assert(isa(I.getType())); + const VectorType *Ty = cast(I.getType()); SDOperand Typ = DAG.getValueType(TLI.getValueType(Ty->getElementType())); setValue(&I, DAG.getNode(OpCode, MVT::Vector, @@ -1413,7 +1413,7 @@ SelectionDAGLowering::visitVectorBinary(User &I, unsigned OpCode) { void SelectionDAGLowering::visitEitherBinary(User &I, unsigned ScalarOp, unsigned VectorOp) { - if (isa(I.getType())) + if (isa(I.getType())) visitVectorBinary(I, VectorOp); else visitScalarBinary(I, ScalarOp); @@ -1501,7 +1501,7 @@ void SelectionDAGLowering::visitSelect(User &I) { SDOperand Cond = getValue(I.getOperand(0)); SDOperand TrueVal = getValue(I.getOperand(1)); SDOperand FalseVal = getValue(I.getOperand(2)); - if (!isa(I.getType())) { + if (!isa(I.getType())) { setValue(&I, DAG.getNode(ISD::SELECT, TrueVal.getValueType(), Cond, TrueVal, FalseVal)); } else { @@ -1611,7 +1611,7 @@ void SelectionDAGLowering::visitBitCast(User &I) { if (DestVT == MVT::Vector) { // This is a cast to a vector from something else. // Get information about the output vector. - const PackedType *DestTy = cast(I.getType()); + const VectorType *DestTy = cast(I.getType()); MVT::ValueType EltVT = TLI.getValueType(DestTy->getElementType()); setValue(&I, DAG.getNode(ISD::VBIT_CONVERT, DestVT, N, DAG.getConstant(DestTy->getNumElements(),MVT::i32), @@ -1793,7 +1793,7 @@ SDOperand SelectionDAGLowering::getLoadFrom(const Type *Ty, SDOperand Ptr, const Value *SV, SDOperand Root, bool isVolatile) { SDOperand L; - if (const PackedType *PTy = dyn_cast(Ty)) { + if (const VectorType *PTy = dyn_cast(Ty)) { MVT::ValueType PVT = TLI.getValueType(PTy->getElementType()); L = DAG.getVecLoad(PTy->getNumElements(), PVT, Root, Ptr, DAG.getSrcValue(SV)); @@ -1863,7 +1863,7 @@ void SelectionDAGLowering::visitTargetIntrinsic(CallInst &I, // If this is a vector type, force it to the right packed type. if (Op.getValueType() == MVT::Vector) { - const PackedType *OpTy = cast(I.getOperand(i)->getType()); + const VectorType *OpTy = cast(I.getOperand(i)->getType()); MVT::ValueType EltVT = TLI.getValueType(OpTy->getElementType()); MVT::ValueType VVT = MVT::getVectorType(EltVT, OpTy->getNumElements()); @@ -1880,7 +1880,7 @@ void SelectionDAGLowering::visitTargetIntrinsic(CallInst &I, if (I.getType() != Type::VoidTy) { MVT::ValueType VT = TLI.getValueType(I.getType()); if (VT == MVT::Vector) { - const PackedType *DestTy = cast(I.getType()); + const VectorType *DestTy = cast(I.getType()); MVT::ValueType EltVT = TLI.getValueType(DestTy->getElementType()); VT = MVT::getVectorType(EltVT, DestTy->getNumElements()); @@ -1915,7 +1915,7 @@ void SelectionDAGLowering::visitTargetIntrinsic(CallInst &I, DAG.setRoot(Chain); } if (I.getType() != Type::VoidTy) { - if (const PackedType *PTy = dyn_cast(I.getType())) { + if (const VectorType *PTy = dyn_cast(I.getType())) { MVT::ValueType EVT = TLI.getValueType(PTy->getElementType()); Result = DAG.getNode(ISD::VBIT_CONVERT, MVT::Vector, Result, DAG.getConstant(PTy->getNumElements(), MVT::i32), @@ -2966,8 +2966,8 @@ TargetLowering::LowerArguments(Function &F, SelectionDAG &DAG) { } else { // Otherwise, this is a vector type. We only support legal vectors // right now. - unsigned NumElems = cast(I->getType())->getNumElements(); - const Type *EltTy = cast(I->getType())->getElementType(); + unsigned NumElems = cast(I->getType())->getNumElements(); + const Type *EltTy = cast(I->getType())->getElementType(); // Figure out if there is a Packed type corresponding to this Vector // type. If so, convert to the packed type. @@ -3031,7 +3031,7 @@ TargetLowering::LowerArguments(Function &F, SelectionDAG &DAG) { } else { // Otherwise, this is a vector type. We only support legal vectors // right now. - const PackedType *PTy = cast(I->getType()); + const VectorType *PTy = cast(I->getType()); unsigned NumElems = PTy->getNumElements(); const Type *EltTy = PTy->getElementType(); @@ -3154,7 +3154,7 @@ TargetLowering::LowerCallTo(SDOperand Chain, const Type *RetTy, } else { // Otherwise, this is a vector type. We only support legal vectors // right now. - const PackedType *PTy = cast(Args[i].Ty); + const VectorType *PTy = cast(Args[i].Ty); unsigned NumElems = PTy->getNumElements(); const Type *EltTy = PTy->getElementType(); @@ -3200,7 +3200,7 @@ TargetLowering::LowerCallTo(SDOperand Chain, const Type *RetTy, } else { // Otherwise, this is a vector type. We only support legal vectors // right now. - const PackedType *PTy = cast(RetTy); + const VectorType *PTy = cast(RetTy); unsigned NumElems = PTy->getNumElements(); const Type *EltTy = PTy->getElementType(); @@ -3238,8 +3238,8 @@ TargetLowering::LowerCallTo(SDOperand Chain, const Type *RetTy, if (VT == MVT::Vector) { // Insert a VBITCONVERT to convert from the packed result type to the // MVT::Vector type. - unsigned NumElems = cast(RetTy)->getNumElements(); - const Type *EltTy = cast(RetTy)->getElementType(); + unsigned NumElems = cast(RetTy)->getNumElements(); + const Type *EltTy = cast(RetTy)->getElementType(); // Figure out if there is a Packed type corresponding to this Vector // type. If so, convert to the packed type. @@ -3938,7 +3938,7 @@ SDOperand SelectionDAGLowering::CopyValueToVirtualRegister(Value *V, } else if (SrcVT == MVT::Vector) { // Handle copies from generic vectors to registers. MVT::ValueType PTyElementVT, PTyLegalElementVT; - unsigned NE = TLI.getPackedTypeBreakdown(cast(V->getType()), + unsigned NE = TLI.getVectorTypeBreakdown(cast(V->getType()), PTyElementVT, PTyLegalElementVT); // Insert a VBIT_CONVERT of the input vector to a "N x PTyElementVT" @@ -4133,7 +4133,7 @@ void SelectionDAGISel::BuildSelectionDAG(SelectionDAG &DAG, BasicBlock *LLVMBB, else { MVT::ValueType VT1,VT2; NumElements = - TLI.getPackedTypeBreakdown(cast(PN->getType()), + TLI.getVectorTypeBreakdown(cast(PN->getType()), VT1, VT2); } for (unsigned i = 0, e = NumElements; i != e; ++i) -- cgit v1.2.3