mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-06 18:46:18 +00:00
Fix comments about vectors to use the current wording.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@39921 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
318f0dee83
commit
07a96765da
@ -412,7 +412,7 @@ public:
|
|||||||
static ConstantVector *getAllOnesValue(const VectorType *Ty);
|
static ConstantVector *getAllOnesValue(const VectorType *Ty);
|
||||||
|
|
||||||
/// isNullValue - Return true if this is the value that would be returned by
|
/// isNullValue - Return true if this is the value that would be returned by
|
||||||
/// getNullValue. This always returns false because zero arrays are always
|
/// getNullValue. This always returns false because zero vectors are always
|
||||||
/// created as ConstantAggregateZero objects.
|
/// created as ConstantAggregateZero objects.
|
||||||
virtual bool isNullValue() const { return false; }
|
virtual bool isNullValue() const { return false; }
|
||||||
|
|
||||||
|
@ -267,7 +267,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/// SequentialType - This is the superclass of the array, pointer and packed
|
/// SequentialType - This is the superclass of the array, pointer and vector
|
||||||
/// type classes. All of these represent "arrays" in memory. The array type
|
/// type classes. All of these represent "arrays" in memory. The array type
|
||||||
/// represents a specifically sized array, pointer types are unsized/unknown
|
/// represents a specifically sized array, pointer types are unsized/unknown
|
||||||
/// size arrays, vector types represent specifically sized arrays that
|
/// size arrays, vector types represent specifically sized arrays that
|
||||||
|
@ -400,7 +400,7 @@ public:
|
|||||||
|
|
||||||
/// A lossless cast is one that does not alter the basic value. It implies
|
/// A lossless cast is one that does not alter the basic value. It implies
|
||||||
/// a no-op cast but is more stringent, preventing things like int->float,
|
/// a no-op cast but is more stringent, preventing things like int->float,
|
||||||
/// long->double, int->ptr, or packed->anything.
|
/// long->double, int->ptr, or vector->anything.
|
||||||
/// @returns true iff the cast is lossless.
|
/// @returns true iff the cast is lossless.
|
||||||
/// @brief Determine if this is a lossless cast.
|
/// @brief Determine if this is a lossless cast.
|
||||||
bool isLosslessCast() const;
|
bool isLosslessCast() const;
|
||||||
|
@ -43,7 +43,7 @@ enum AlignTypeEnum {
|
|||||||
/// Target alignment element.
|
/// Target alignment element.
|
||||||
///
|
///
|
||||||
/// Stores the alignment data associated with a given alignment type (pointer,
|
/// Stores the alignment data associated with a given alignment type (pointer,
|
||||||
/// integer, packed/vector, float) and type bit width.
|
/// integer, vector, float) and type bit width.
|
||||||
///
|
///
|
||||||
/// @note The unusual order of elements in the structure attempts to reduce
|
/// @note The unusual order of elements in the structure attempts to reduce
|
||||||
/// padding and make the structure slightly more cache friendly.
|
/// padding and make the structure slightly more cache friendly.
|
||||||
|
@ -574,7 +574,7 @@ BasicAliasAnalysis::CheckGEPInstructions(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (G1OC != G2OC) {
|
if (G1OC != G2OC) {
|
||||||
// Handle the "be careful" case above: if this is an array/packed
|
// Handle the "be careful" case above: if this is an array/vector
|
||||||
// subscript, scan for a subsequent variable array index.
|
// subscript, scan for a subsequent variable array index.
|
||||||
if (isa<SequentialType>(BasePtr1Ty)) {
|
if (isa<SequentialType>(BasePtr1Ty)) {
|
||||||
const Type *NextTy =
|
const Type *NextTy =
|
||||||
|
@ -2846,7 +2846,7 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
|
|||||||
// type. If so, convert to the vector type.
|
// type. If so, convert to the vector type.
|
||||||
MVT::ValueType TVT = MVT::getVectorType(EVT, NumElems);
|
MVT::ValueType TVT = MVT::getVectorType(EVT, NumElems);
|
||||||
if (TLI.isTypeLegal(TVT)) {
|
if (TLI.isTypeLegal(TVT)) {
|
||||||
// Turn this into a bit convert of the packed input.
|
// Turn this into a bit convert of the vector input.
|
||||||
Result = DAG.getNode(ISD::BIT_CONVERT, Node->getValueType(0),
|
Result = DAG.getNode(ISD::BIT_CONVERT, Node->getValueType(0),
|
||||||
LegalizeOp(Node->getOperand(0)));
|
LegalizeOp(Node->getOperand(0)));
|
||||||
break;
|
break;
|
||||||
@ -3935,7 +3935,7 @@ SDOperand SelectionDAGLegalize::ExpandSCALAR_TO_VECTOR(SDNode *Node) {
|
|||||||
|
|
||||||
|
|
||||||
/// ExpandBUILD_VECTOR - Expand a BUILD_VECTOR node on targets that don't
|
/// ExpandBUILD_VECTOR - Expand a BUILD_VECTOR node on targets that don't
|
||||||
/// support the operation, but do support the resultant packed vector type.
|
/// support the operation, but do support the resultant vector type.
|
||||||
SDOperand SelectionDAGLegalize::ExpandBUILD_VECTOR(SDNode *Node) {
|
SDOperand SelectionDAGLegalize::ExpandBUILD_VECTOR(SDNode *Node) {
|
||||||
|
|
||||||
// If the only non-undef value is the low element, turn this into a
|
// If the only non-undef value is the low element, turn this into a
|
||||||
|
@ -840,13 +840,13 @@ SDOperand SelectionDAGLowering::getValue(const Value *V) {
|
|||||||
|
|
||||||
// Now that we know the number and type of the elements, push a
|
// Now that we know the number and type of the elements, push a
|
||||||
// Constant or ConstantFP node onto the ops list for each element of
|
// Constant or ConstantFP node onto the ops list for each element of
|
||||||
// the packed constant.
|
// the vector constant.
|
||||||
SmallVector<SDOperand, 8> Ops;
|
SmallVector<SDOperand, 8> Ops;
|
||||||
if (ConstantVector *CP = dyn_cast<ConstantVector>(C)) {
|
if (ConstantVector *CP = dyn_cast<ConstantVector>(C)) {
|
||||||
for (unsigned i = 0; i != NumElements; ++i)
|
for (unsigned i = 0; i != NumElements; ++i)
|
||||||
Ops.push_back(getValue(CP->getOperand(i)));
|
Ops.push_back(getValue(CP->getOperand(i)));
|
||||||
} else {
|
} else {
|
||||||
assert(isa<ConstantAggregateZero>(C) && "Unknown packed constant!");
|
assert(isa<ConstantAggregateZero>(C) && "Unknown vector constant!");
|
||||||
SDOperand Op;
|
SDOperand Op;
|
||||||
if (MVT::isFloatingPoint(PVT))
|
if (MVT::isFloatingPoint(PVT))
|
||||||
Op = DAG.getConstantFP(0, PVT);
|
Op = DAG.getConstantFP(0, PVT);
|
||||||
|
@ -52,7 +52,7 @@ class SDTCisOpSmallerThanOp<int SmallOp, int BigOp> : SDTypeConstraint<SmallOp>{
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// SDTCisIntVectorOfSameSize - This indicates that ThisOp and OtherOp are
|
/// SDTCisIntVectorOfSameSize - This indicates that ThisOp and OtherOp are
|
||||||
/// packed vector types, and that ThisOp is the result of
|
/// vector types, and that ThisOp is the result of
|
||||||
/// MVT::getIntVectorWithNumElements with the number of elements that ThisOp
|
/// MVT::getIntVectorWithNumElements with the number of elements that ThisOp
|
||||||
/// has.
|
/// has.
|
||||||
class SDTCisIntVectorOfSameSize<int ThisOp, int OtherOp>
|
class SDTCisIntVectorOfSameSize<int ThisOp, int OtherOp>
|
||||||
|
@ -1506,7 +1506,7 @@ Value *InstCombiner::SimplifyDemandedVectorElts(Value *V, uint64_t DemandedElts,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Instruction::BitCast: {
|
case Instruction::BitCast: {
|
||||||
// Packed->packed casts only.
|
// Vector->vector casts only.
|
||||||
const VectorType *VTy = dyn_cast<VectorType>(I->getOperand(0)->getType());
|
const VectorType *VTy = dyn_cast<VectorType>(I->getOperand(0)->getType());
|
||||||
if (!VTy) break;
|
if (!VTy) break;
|
||||||
unsigned InVWidth = VTy->getNumElements();
|
unsigned InVWidth = VTy->getNumElements();
|
||||||
@ -9354,16 +9354,16 @@ static Value *FindScalarElement(Value *V, unsigned EltNo) {
|
|||||||
|
|
||||||
Instruction *InstCombiner::visitExtractElementInst(ExtractElementInst &EI) {
|
Instruction *InstCombiner::visitExtractElementInst(ExtractElementInst &EI) {
|
||||||
|
|
||||||
// If packed val is undef, replace extract with scalar undef.
|
// If vector val is undef, replace extract with scalar undef.
|
||||||
if (isa<UndefValue>(EI.getOperand(0)))
|
if (isa<UndefValue>(EI.getOperand(0)))
|
||||||
return ReplaceInstUsesWith(EI, UndefValue::get(EI.getType()));
|
return ReplaceInstUsesWith(EI, UndefValue::get(EI.getType()));
|
||||||
|
|
||||||
// If packed val is constant 0, replace extract with scalar 0.
|
// If vector val is constant 0, replace extract with scalar 0.
|
||||||
if (isa<ConstantAggregateZero>(EI.getOperand(0)))
|
if (isa<ConstantAggregateZero>(EI.getOperand(0)))
|
||||||
return ReplaceInstUsesWith(EI, Constant::getNullValue(EI.getType()));
|
return ReplaceInstUsesWith(EI, Constant::getNullValue(EI.getType()));
|
||||||
|
|
||||||
if (ConstantVector *C = dyn_cast<ConstantVector>(EI.getOperand(0))) {
|
if (ConstantVector *C = dyn_cast<ConstantVector>(EI.getOperand(0))) {
|
||||||
// If packed val is constant with uniform operands, replace EI
|
// If vector val is constant with uniform operands, replace EI
|
||||||
// with that operand
|
// with that operand
|
||||||
Constant *op0 = C->getOperand(0);
|
Constant *op0 = C->getOperand(0);
|
||||||
for (unsigned i = 1; i < C->getNumOperands(); ++i)
|
for (unsigned i = 1; i < C->getNumOperands(); ++i)
|
||||||
|
@ -652,7 +652,7 @@ void SROA::RewriteBitCastUserOfAlloca(Instruction *BCInst, AllocationInst *AI,
|
|||||||
if (CI->isZero()) {
|
if (CI->isZero()) {
|
||||||
StoreVal = Constant::getNullValue(EltTy); // 0.0, null, 0, <0,0>
|
StoreVal = Constant::getNullValue(EltTy); // 0.0, null, 0, <0,0>
|
||||||
} else {
|
} else {
|
||||||
// If EltTy is a packed type, get the element type.
|
// If EltTy is a vector type, get the element type.
|
||||||
const Type *ValTy = EltTy;
|
const Type *ValTy = EltTy;
|
||||||
if (const VectorType *VTy = dyn_cast<VectorType>(ValTy))
|
if (const VectorType *VTy = dyn_cast<VectorType>(ValTy))
|
||||||
ValTy = VTy->getElementType();
|
ValTy = VTy->getElementType();
|
||||||
@ -989,7 +989,7 @@ const Type *SROA::CanConvertToScalar(Value *V, bool &IsNotTrivial) {
|
|||||||
if (const ArrayType *ATy = dyn_cast<ArrayType>(AggTy)) {
|
if (const ArrayType *ATy = dyn_cast<ArrayType>(AggTy)) {
|
||||||
if (Idx >= ATy->getNumElements()) return 0; // Out of range.
|
if (Idx >= ATy->getNumElements()) return 0; // Out of range.
|
||||||
} else if (const VectorType *VectorTy = dyn_cast<VectorType>(AggTy)) {
|
} else if (const VectorType *VectorTy = dyn_cast<VectorType>(AggTy)) {
|
||||||
// Getting an element of the packed vector.
|
// Getting an element of the vector.
|
||||||
if (Idx >= VectorTy->getNumElements()) return 0; // Out of range.
|
if (Idx >= VectorTy->getNumElements()) return 0; // Out of range.
|
||||||
|
|
||||||
// Merge in the vector type.
|
// Merge in the vector type.
|
||||||
|
@ -82,8 +82,8 @@ Value *llvm::MapValue(const Value *V, ValueMapTy &VM) {
|
|||||||
for (unsigned i = 0, e = CP->getNumOperands(); i != e; ++i) {
|
for (unsigned i = 0, e = CP->getNumOperands(); i != e; ++i) {
|
||||||
Value *MV = MapValue(CP->getOperand(i), VM);
|
Value *MV = MapValue(CP->getOperand(i), VM);
|
||||||
if (MV != CP->getOperand(i)) {
|
if (MV != CP->getOperand(i)) {
|
||||||
// This packed value must contain a reference to a global, make a new
|
// This vector value must contain a reference to a global, make a new
|
||||||
// packed constant and return it.
|
// vector constant and return it.
|
||||||
//
|
//
|
||||||
std::vector<Constant*> Values;
|
std::vector<Constant*> Values;
|
||||||
Values.reserve(CP->getNumOperands());
|
Values.reserve(CP->getNumOperands());
|
||||||
|
@ -37,7 +37,7 @@ using namespace llvm;
|
|||||||
|
|
||||||
/// CastConstantVector - Convert the specified ConstantVector node to the
|
/// CastConstantVector - Convert the specified ConstantVector node to the
|
||||||
/// specified vector type. At this point, we know that the elements of the
|
/// specified vector type. At this point, we know that the elements of the
|
||||||
/// input packed constant are all simple integer or FP values.
|
/// input vector constant are all simple integer or FP values.
|
||||||
static Constant *CastConstantVector(ConstantVector *CV,
|
static Constant *CastConstantVector(ConstantVector *CV,
|
||||||
const VectorType *DstTy) {
|
const VectorType *DstTy) {
|
||||||
unsigned SrcNumElts = CV->getType()->getNumElements();
|
unsigned SrcNumElts = CV->getType()->getNumElements();
|
||||||
@ -258,7 +258,7 @@ Constant *llvm::ConstantFoldCastInstruction(unsigned opc, const Constant *V,
|
|||||||
const_cast<Constant*>(V), &IdxList[0], IdxList.size());
|
const_cast<Constant*>(V), &IdxList[0], IdxList.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle casts from one packed constant to another. We know that the src
|
// Handle casts from one vector constant to another. We know that the src
|
||||||
// and dest type have the same size (otherwise its an illegal cast).
|
// and dest type have the same size (otherwise its an illegal cast).
|
||||||
if (const VectorType *DestPTy = dyn_cast<VectorType>(DestTy)) {
|
if (const VectorType *DestPTy = dyn_cast<VectorType>(DestTy)) {
|
||||||
if (const VectorType *SrcTy = dyn_cast<VectorType>(V->getType())) {
|
if (const VectorType *SrcTy = dyn_cast<VectorType>(V->getType())) {
|
||||||
@ -308,7 +308,7 @@ Constant *llvm::ConstantFoldCastInstruction(unsigned opc, const Constant *V,
|
|||||||
assert(DestTy == Type::DoubleTy && "Unknown FP type!");
|
assert(DestTy == Type::DoubleTy && "Unknown FP type!");
|
||||||
return ConstantFP::get(DestTy, CI->getValue().bitsToDouble());
|
return ConstantFP::get(DestTy, CI->getValue().bitsToDouble());
|
||||||
}
|
}
|
||||||
// Otherwise, can't fold this (packed?)
|
// Otherwise, can't fold this (vector?)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -373,7 +373,7 @@ Constant *llvm::ConstantFoldInsertElementInstruction(const Constant *Val,
|
|||||||
if (!CIdx) return 0;
|
if (!CIdx) return 0;
|
||||||
APInt idxVal = CIdx->getValue();
|
APInt idxVal = CIdx->getValue();
|
||||||
if (isa<UndefValue>(Val)) {
|
if (isa<UndefValue>(Val)) {
|
||||||
// Insertion of scalar constant into packed undef
|
// Insertion of scalar constant into vector undef
|
||||||
// Optimize away insertion of undef
|
// Optimize away insertion of undef
|
||||||
if (isa<UndefValue>(Elt))
|
if (isa<UndefValue>(Elt))
|
||||||
return const_cast<Constant*>(Val);
|
return const_cast<Constant*>(Val);
|
||||||
@ -391,7 +391,7 @@ Constant *llvm::ConstantFoldInsertElementInstruction(const Constant *Val,
|
|||||||
return ConstantVector::get(Ops);
|
return ConstantVector::get(Ops);
|
||||||
}
|
}
|
||||||
if (isa<ConstantAggregateZero>(Val)) {
|
if (isa<ConstantAggregateZero>(Val)) {
|
||||||
// Insertion of scalar constant into packed aggregate zero
|
// Insertion of scalar constant into vector aggregate zero
|
||||||
// Optimize away insertion of zero
|
// Optimize away insertion of zero
|
||||||
if (Elt->isNullValue())
|
if (Elt->isNullValue())
|
||||||
return const_cast<Constant*>(Val);
|
return const_cast<Constant*>(Val);
|
||||||
@ -409,7 +409,7 @@ Constant *llvm::ConstantFoldInsertElementInstruction(const Constant *Val,
|
|||||||
return ConstantVector::get(Ops);
|
return ConstantVector::get(Ops);
|
||||||
}
|
}
|
||||||
if (const ConstantVector *CVal = dyn_cast<ConstantVector>(Val)) {
|
if (const ConstantVector *CVal = dyn_cast<ConstantVector>(Val)) {
|
||||||
// Insertion of scalar constant into packed constant
|
// Insertion of scalar constant into vector constant
|
||||||
std::vector<Constant*> Ops;
|
std::vector<Constant*> Ops;
|
||||||
Ops.reserve(CVal->getNumOperands());
|
Ops.reserve(CVal->getNumOperands());
|
||||||
for (unsigned i = 0; i < CVal->getNumOperands(); ++i) {
|
for (unsigned i = 0; i < CVal->getNumOperands(); ++i) {
|
||||||
@ -429,7 +429,7 @@ Constant *llvm::ConstantFoldShuffleVectorInstruction(const Constant *V1,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// EvalVectorOp - Given two packed constants and a function pointer, apply the
|
/// EvalVectorOp - Given two vector constants and a function pointer, apply the
|
||||||
/// function pointer to each element pair, producing a new ConstantVector
|
/// function pointer to each element pair, producing a new ConstantVector
|
||||||
/// constant.
|
/// constant.
|
||||||
static Constant *EvalVectorOp(const ConstantVector *V1,
|
static Constant *EvalVectorOp(const ConstantVector *V1,
|
||||||
|
@ -1109,7 +1109,7 @@ void Verifier::VerifyIntrinsicPrototype(Intrinsic::ID ID, Function *F, ...) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if (TypeID == Type::VectorTyID) {
|
} else if (TypeID == Type::VectorTyID) {
|
||||||
// If this is a packed argument, verify the number and type of elements.
|
// If this is a vector argument, verify the number and type of elements.
|
||||||
const VectorType *PTy = cast<VectorType>(Ty);
|
const VectorType *PTy = cast<VectorType>(Ty);
|
||||||
int ElemTy = va_arg(VA, int);
|
int ElemTy = va_arg(VA, int);
|
||||||
if (ElemTy != PTy->getElementType()->getTypeID()) {
|
if (ElemTy != PTy->getElementType()->getTypeID()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user