For PR1195:
Change use of "packed" term to "vector" in comments, strings, variable
names, etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34300 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/llvmAsmParser.y
index 3f71158..3038a79 100644
--- a/lib/AsmParser/llvmAsmParser.y
+++ b/lib/AsmParser/llvmAsmParser.y
@@ -1292,7 +1292,7 @@
delete $4;
CHECK_FOR_ERROR
}
- | '<' EUINT64VAL 'x' Types '>' { // Packed array type?
+ | '<' EUINT64VAL 'x' Types '>' { // Vector type?
const llvm::Type* ElemTy = $4->get();
if ((unsigned)$2 != $2)
GEN_ERROR("Unsigned result not equal to signed result");
@@ -1525,7 +1525,7 @@
// Check to ensure that Type is not packed
if (STy->isPacked())
- GEN_ERROR("Unpacked Initializer to packed type '" + STy->getDescription() + "'");
+ GEN_ERROR("Unpacked Initializer to vector type '" + STy->getDescription() + "'");
$$ = ConstantStruct::get(STy, *$3);
delete $1; delete $3;
@@ -1544,7 +1544,7 @@
// Check to ensure that Type is not packed
if (STy->isPacked())
- GEN_ERROR("Unpacked Initializer to packed type '" + STy->getDescription() + "'");
+ GEN_ERROR("Unpacked Initializer to vector type '" + STy->getDescription() + "'");
$$ = ConstantStruct::get(STy, std::vector<Constant*>());
delete $1;
@@ -1569,7 +1569,8 @@
// Check to ensure that Type is packed
if (!STy->isPacked())
- GEN_ERROR("Packed Initializer to unpacked type '" + STy->getDescription() + "'");
+ GEN_ERROR("Vector initializer to non-vector type '" +
+ STy->getDescription() + "'");
$$ = ConstantStruct::get(STy, *$4);
delete $1; delete $4;
@@ -1588,7 +1589,8 @@
// Check to ensure that Type is packed
if (!STy->isPacked())
- GEN_ERROR("Packed Initializer to unpacked type '" + STy->getDescription() + "'");
+ GEN_ERROR("Vector initializer to non-vector type '" +
+ STy->getDescription() + "'");
$$ = ConstantStruct::get(STy, std::vector<Constant*>());
delete $1;
@@ -2592,7 +2594,7 @@
($1 == Instruction::URem ||
$1 == Instruction::SRem ||
$1 == Instruction::FRem))
- GEN_ERROR("Remainder not supported on packed types");
+ GEN_ERROR("Remainder not supported on vector types");
Value* val1 = getVal(*$2, $3);
CHECK_FOR_ERROR
Value* val2 = getVal(*$2, $5);
@@ -2623,7 +2625,7 @@
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*$3)->getDescription());
if (isa<VectorType>((*$3).get()))
- GEN_ERROR("Packed types not supported by icmp instruction");
+ GEN_ERROR("Vector types not supported by icmp instruction");
Value* tmpVal1 = getVal(*$3, $4);
CHECK_FOR_ERROR
Value* tmpVal2 = getVal(*$3, $6);
@@ -2636,7 +2638,7 @@
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*$3)->getDescription());
if (isa<VectorType>((*$3).get()))
- GEN_ERROR("Packed types not supported by fcmp instruction");
+ GEN_ERROR("Vector types not supported by fcmp instruction");
Value* tmpVal1 = getVal(*$3, $4);
CHECK_FOR_ERROR
Value* tmpVal2 = getVal(*$3, $6);
diff --git a/lib/Bytecode/Reader/Analyzer.cpp b/lib/Bytecode/Reader/Analyzer.cpp
index 75b3ca7..aef482a 100644
--- a/lib/Bytecode/Reader/Analyzer.cpp
+++ b/lib/Bytecode/Reader/Analyzer.cpp
@@ -427,7 +427,7 @@
const VectorType* PT,
Constant**Elements, unsigned NumElts,
unsigned TypeSlot,
- Constant* PackedVal)
+ Constant* VectorVal)
{
if (os) {
*os << " PACKD: ";
@@ -439,7 +439,7 @@
*os << "\n";
}
*os << " Value=";
- PackedVal->print(*os);
+ VectorVal->print(*os);
*os << "\n";
}
diff --git a/lib/Bytecode/Reader/Reader.cpp b/lib/Bytecode/Reader/Reader.cpp
index bafe7d3..200f0d7 100644
--- a/lib/Bytecode/Reader/Reader.cpp
+++ b/lib/Bytecode/Reader/Reader.cpp
@@ -482,12 +482,12 @@
break;
}
case Instruction::InsertElement: {
- const VectorType *PackedTy = dyn_cast<VectorType>(InstTy);
- if (!PackedTy || Oprnds.size() != 3)
+ const VectorType *VectorTy = dyn_cast<VectorType>(InstTy);
+ if (!VectorTy || Oprnds.size() != 3)
error("Invalid insertelement instruction!");
Value *V1 = getValue(iType, Oprnds[0]);
- Value *V2 = getValue(getTypeSlot(PackedTy->getElementType()),Oprnds[1]);
+ Value *V2 = getValue(getTypeSlot(VectorTy->getElementType()),Oprnds[1]);
Value *V3 = getValue(Int32TySlot, Oprnds[2]);
if (!InsertElementInst::isValidOperands(V1, V2, V3))
@@ -496,13 +496,13 @@
break;
}
case Instruction::ShuffleVector: {
- const VectorType *PackedTy = dyn_cast<VectorType>(InstTy);
- if (!PackedTy || Oprnds.size() != 3)
+ const VectorType *VectorTy = dyn_cast<VectorType>(InstTy);
+ if (!VectorTy || Oprnds.size() != 3)
error("Invalid shufflevector instruction!");
Value *V1 = getValue(iType, Oprnds[0]);
Value *V2 = getValue(iType, Oprnds[1]);
const VectorType *EltTy =
- VectorType::get(Type::Int32Ty, PackedTy->getNumElements());
+ VectorType::get(Type::Int32Ty, VectorTy->getNumElements());
Value *V3 = getValue(getTypeSlot(EltTy), Oprnds[2]);
if (!ShuffleVectorInst::isValidOperands(V1, V2, V3))
error("Invalid shufflevector instruction!");
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index 87dffdc..eb44250 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -112,7 +112,7 @@
std::map<SDOperand, std::pair<SDOperand, SDOperand> > SplitNodes;
/// PackedNodes - For nodes that need to be packed from MVT::Vector types to
- /// concrete packed types, this contains the mapping of ones we have already
+ /// concrete vector types, this contains the mapping of ones we have already
/// processed to the result.
std::map<SDOperand, SDOperand> PackedNodes;
@@ -1641,10 +1641,10 @@
MVT::ValueType EVT = cast<VTSDNode>(*(InVal->op_end()-1))->getVT();
// Figure out if there is a Packed type corresponding to this Vector
- // type. If so, convert to the packed type.
+ // type. If so, convert to the vector type.
MVT::ValueType TVT = MVT::getVectorType(EVT, NumElems);
if (TVT != MVT::Other && TLI.isTypeLegal(TVT)) {
- // Turn this into a return of the packed type.
+ // Turn this into a return of the vector type.
Tmp2 = PackVectorOp(Tmp2, TVT);
Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2, Tmp3);
} else if (NumElems == 1) {
@@ -1793,10 +1793,10 @@
MVT::ValueType EVT = cast<VTSDNode>(*(InVal->op_end()-1))->getVT();
// Figure out if there is a Packed type corresponding to this Vector
- // type. If so, convert to the packed type.
+ // type. If so, convert to the vector type.
MVT::ValueType TVT = MVT::getVectorType(EVT, NumElems);
if (TVT != MVT::Other && TLI.isTypeLegal(TVT)) {
- // Turn this into a normal store of the packed type.
+ // Turn this into a normal store of the vector type.
Tmp3 = PackVectorOp(Node->getOperand(1), TVT);
Result = DAG.getStore(Tmp1, Tmp3, Tmp2, ST->getSrcValue(),
ST->getSrcValueOffset());
@@ -2810,7 +2810,7 @@
MVT::ValueType EVT = cast<VTSDNode>(*(InVal->op_end()-1))->getVT();
// Figure out if there is a Packed type corresponding to this Vector
- // type. If so, convert to the packed type.
+ // type. If so, convert to the vector type.
MVT::ValueType TVT = MVT::getVectorType(EVT, NumElems);
if (TVT != MVT::Other && TLI.isTypeLegal(TVT)) {
// Turn this into a bit convert of the packed input.
@@ -3508,7 +3508,7 @@
MVT::ValueType EVT = cast<VTSDNode>(*(InVal->op_end()-1))->getVT();
// Figure out if there is a Packed type corresponding to this Vector
- // type. If so, convert to the packed type.
+ // type. If so, convert to the vector type.
MVT::ValueType TVT = MVT::getVectorType(EVT, NumElems);
if (TVT != MVT::Other && TLI.isTypeLegal(TVT)) {
// Turn this into a packed extract_vector_elt operation.
@@ -5553,7 +5553,7 @@
MVT::ValueType EVT = cast<VTSDNode>(*(InVal->op_end()-1))->getVT();
// Figure out if there is a Packed type corresponding to this Vector
- // type. If so, convert to the packed type.
+ // type. If so, convert to the vector type.
MVT::ValueType TVT = MVT::getVectorType(EVT, NumElems);
if (TVT != MVT::Other && TLI.isTypeLegal(TVT)) {
// Turn this into a bit convert of the packed input.
diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
index d290d88..f6e9b2c 100644
--- a/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
@@ -332,7 +332,7 @@
if (Align == 0) {
Align = TM.getTargetData()->getPreferredTypeAlignmentShift(Type);
if (Align == 0) {
- // Alignment of packed types. FIXME!
+ // Alignment of vector types. FIXME!
Align = TM.getTargetData()->getTypeSize(Type);
Align = Log2_64(Align);
}
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index a156bda..38d2300 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -303,7 +303,7 @@
// a <2 x int64> -> 4 x i32 registers.
unsigned NumVectorRegs = 1;
- // If this is a packed type, figure out what type it will decompose into
+ // If this is a vector type, figure out what type it will decompose into
// and how many of the elements it will use.
if (VT == MVT::Vector) {
const VectorType *PTy = cast<VectorType>(V->getType());
@@ -1861,7 +1861,7 @@
for (unsigned i = 1, e = I.getNumOperands(); i != e; ++i) {
SDOperand Op = getValue(I.getOperand(i));
- // If this is a vector type, force it to the right packed type.
+ // If this is a vector type, force it to the right vector type.
if (Op.getValueType() == MVT::Vector) {
const VectorType *OpTy = cast<VectorType>(I.getOperand(i)->getType());
MVT::ValueType EltVT = TLI.getValueType(OpTy->getElementType());
@@ -2970,7 +2970,7 @@
const Type *EltTy = cast<VectorType>(I->getType())->getElementType();
// Figure out if there is a Packed type corresponding to this Vector
- // type. If so, convert to the packed type.
+ // type. If so, convert to the vector type.
MVT::ValueType TVT = MVT::getVectorType(getValueType(EltTy), NumElems);
if (TVT != MVT::Other && isTypeLegal(TVT)) {
RetVals.push_back(TVT);
@@ -3036,7 +3036,7 @@
const Type *EltTy = PTy->getElementType();
// Figure out if there is a Packed type corresponding to this Vector
- // type. If so, convert to the packed type.
+ // type. If so, convert to the vector type.
MVT::ValueType TVT = MVT::getVectorType(getValueType(EltTy), NumElems);
if (TVT != MVT::Other && isTypeLegal(TVT)) {
SDOperand N = SDOperand(Result, i++);
@@ -3159,10 +3159,10 @@
const Type *EltTy = PTy->getElementType();
// Figure out if there is a Packed type corresponding to this Vector
- // type. If so, convert to the packed type.
+ // type. If so, convert to the vector type.
MVT::ValueType TVT = MVT::getVectorType(getValueType(EltTy), NumElems);
if (TVT != MVT::Other && isTypeLegal(TVT)) {
- // Insert a VBIT_CONVERT of the MVT::Vector type to the packed type.
+ // Insert a VBIT_CONVERT of the MVT::Vector type to the vector type.
Op = DAG.getNode(ISD::VBIT_CONVERT, TVT, Op);
Ops.push_back(Op);
Ops.push_back(DAG.getConstant(Flags, MVT::i32));
@@ -3205,7 +3205,7 @@
const Type *EltTy = PTy->getElementType();
// Figure out if there is a Packed type corresponding to this Vector
- // type. If so, convert to the packed type.
+ // type. If so, convert to the vector type.
MVT::ValueType TVT = MVT::getVectorType(getValueType(EltTy), NumElems);
if (TVT != MVT::Other && isTypeLegal(TVT)) {
RetTys.push_back(TVT);
@@ -3242,7 +3242,7 @@
const Type *EltTy = cast<VectorType>(RetTy)->getElementType();
// Figure out if there is a Packed type corresponding to this Vector
- // type. If so, convert to the packed type.
+ // type. If so, convert to the vector type.
MVT::ValueType TVT = MVT::getVectorType(getValueType(EltTy),NumElems);
if (TVT != MVT::Other && isTypeLegal(TVT)) {
// Insert a VBIT_CONVERT of the FORMAL_ARGUMENTS to a
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp
index 460bf66..b434d31 100644
--- a/lib/Target/CBackend/CBackend.cpp
+++ b/lib/Target/CBackend/CBackend.cpp
@@ -1727,7 +1727,7 @@
// Push the struct onto the stack and recursively push all structs
// this one depends on.
//
-// TODO: Make this work properly with packed types
+// TODO: Make this work properly with vector types
//
void CWriter::printContainedStructs(const Type *Ty,
std::set<const StructType*> &StructPrinted){
diff --git a/lib/Target/README.txt b/lib/Target/README.txt
index 8cead8e..437e93c 100644
--- a/lib/Target/README.txt
+++ b/lib/Target/README.txt
@@ -135,9 +135,9 @@
//===---------------------------------------------------------------------===//
-For packed types, TargetData.cpp::getTypeInfo() returns alignment that is equal
+For vector types, TargetData.cpp::getTypeInfo() returns alignment that is equal
to the type size. It works but can be overly conservative as the alignment of
-specific packed types are target dependent.
+specific vector types are target dependent.
//===---------------------------------------------------------------------===//
@@ -150,7 +150,7 @@
//===---------------------------------------------------------------------===//
-We should constant fold packed type casts at the LLVM level, regardless of the
+We should constant fold vector type casts at the LLVM level, regardless of the
cast. Currently we cannot fold some casts because we don't have TargetData
information in the constant folder, so we don't know the endianness of the
target!
diff --git a/lib/Transforms/Scalar/LowerPacked.cpp b/lib/Transforms/Scalar/LowerPacked.cpp
index d841685..4e1d280 100644
--- a/lib/Transforms/Scalar/LowerPacked.cpp
+++ b/lib/Transforms/Scalar/LowerPacked.cpp
@@ -207,7 +207,7 @@
void LowerPacked::visitLoadInst(LoadInst& LI)
{
- // Make sure what we are dealing with is a packed type
+ // Make sure what we are dealing with is a vector type
if (const VectorType* PKT = dyn_cast<VectorType>(LI.getType())) {
// Initialization, Idx is needed for getelementptr needed later
std::vector<Value*> Idx(2);
@@ -217,7 +217,7 @@
PKT->getNumElements());
PointerType* APT = PointerType::get(AT);
- // Cast the pointer to packed type to an equivalent array
+ // Cast the pointer to vector type to an equivalent array
Value* array = new BitCastInst(LI.getPointerOperand(), APT,
LI.getName() + ".a", &LI);
diff --git a/lib/Transforms/Scalar/ScalarReplAggregates.cpp b/lib/Transforms/Scalar/ScalarReplAggregates.cpp
index 480f2aa..70bb6a6 100644
--- a/lib/Transforms/Scalar/ScalarReplAggregates.cpp
+++ b/lib/Transforms/Scalar/ScalarReplAggregates.cpp
@@ -561,12 +561,12 @@
if (const ArrayType *ATy = dyn_cast<ArrayType>(AggTy)) {
if (Idx >= ATy->getNumElements()) return 0; // Out of range.
- } else if (const VectorType *PackedTy = dyn_cast<VectorType>(AggTy)) {
+ } else if (const VectorType *VectorTy = dyn_cast<VectorType>(AggTy)) {
// Getting an element of the packed vector.
- if (Idx >= PackedTy->getNumElements()) return 0; // Out of range.
+ if (Idx >= VectorTy->getNumElements()) return 0; // Out of range.
- // Merge in the packed type.
- if (MergeInType(PackedTy, UsedType, TD)) return 0;
+ // Merge in the vector type.
+ if (MergeInType(VectorTy, UsedType, TD)) return 0;
const Type *SubTy = CanConvertToScalar(GEP, IsNotTrivial);
if (SubTy == 0) return 0;
@@ -640,8 +640,8 @@
Value *NV = new LoadInst(NewAI, LI->getName(), LI);
if (NV->getType() != LI->getType()) {
if (const VectorType *PTy = dyn_cast<VectorType>(NV->getType())) {
- // If the result alloca is a packed type, this is either an element
- // access or a bitcast to another packed type.
+ // If the result alloca is a vector type, this is either an element
+ // access or a bitcast to another vector type.
if (isa<VectorType>(LI->getType())) {
NV = new BitCastInst(NV, LI->getType(), LI->getName(), LI);
} else {
@@ -703,8 +703,8 @@
Value *Old = new LoadInst(NewAI, NewAI->getName()+".in", SI);
if (const VectorType *PTy = dyn_cast<VectorType>(AllocaType)) {
- // If the result alloca is a packed type, this is either an element
- // access or a bitcast to another packed type.
+ // If the result alloca is a vector type, this is either an element
+ // access or a bitcast to another vector type.
if (isa<VectorType>(SV->getType())) {
SV = new BitCastInst(SV, AllocaType, SV->getName(), SI);
} else {
diff --git a/lib/VMCore/ConstantFold.cpp b/lib/VMCore/ConstantFold.cpp
index 35a0eab..7cb4b7b 100644
--- a/lib/VMCore/ConstantFold.cpp
+++ b/lib/VMCore/ConstantFold.cpp
@@ -36,7 +36,7 @@
//===----------------------------------------------------------------------===//
/// CastConstantVector - Convert the specified ConstantVector node to the
-/// specified packed 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.
static Constant *CastConstantVector(ConstantVector *CP,
const VectorType *DstTy) {
diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp
index 992159f..ab2d273 100644
--- a/lib/VMCore/Constants.cpp
+++ b/lib/VMCore/Constants.cpp
@@ -1135,7 +1135,7 @@
}
static ManagedStatic<ValueMap<std::vector<Constant*>, VectorType,
- ConstantVector> > PackedConstants;
+ ConstantVector> > VectorConstants;
Constant *ConstantVector::get(const VectorType *Ty,
const std::vector<Constant*> &V) {
@@ -1143,10 +1143,10 @@
if (!V.empty()) {
Constant *C = V[0];
if (!C->isNullValue())
- return PackedConstants->getOrCreate(Ty, V);
+ return VectorConstants->getOrCreate(Ty, V);
for (unsigned i = 1, e = V.size(); i != e; ++i)
if (V[i] != C)
- return PackedConstants->getOrCreate(Ty, V);
+ return VectorConstants->getOrCreate(Ty, V);
}
return ConstantAggregateZero::get(Ty);
}
@@ -1159,7 +1159,7 @@
// destroyConstant - Remove the constant from the constant table...
//
void ConstantVector::destroyConstant() {
- PackedConstants->remove(this);
+ VectorConstants->remove(this);
destroyConstantImpl();
}
@@ -1793,7 +1793,7 @@
Constant *ConstantExpr::getExtractElement(Constant *Val, Constant *Idx) {
assert(isa<VectorType>(Val->getType()) &&
- "Tried to create extractelement operation on non-packed type!");
+ "Tried to create extractelement operation on non-vector type!");
assert(Idx->getType() == Type::Int32Ty &&
"Extractelement index must be i32 type!");
return getExtractElementTy(cast<VectorType>(Val->getType())->getElementType(),
@@ -1815,7 +1815,7 @@
Constant *ConstantExpr::getInsertElement(Constant *Val, Constant *Elt,
Constant *Idx) {
assert(isa<VectorType>(Val->getType()) &&
- "Tried to create insertelement operation on non-packed type!");
+ "Tried to create insertelement operation on non-vector type!");
assert(Elt->getType() == cast<VectorType>(Val->getType())->getElementType()
&& "Insertelement types must match!");
assert(Idx->getType() == Type::Int32Ty &&
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp
index e591845..39fbb3a 100644
--- a/lib/VMCore/Instructions.cpp
+++ b/lib/VMCore/Instructions.cpp
@@ -1000,7 +1000,7 @@
bool InsertElementInst::isValidOperands(const Value *Vec, const Value *Elt,
const Value *Index) {
if (!isa<VectorType>(Vec->getType()))
- return false; // First operand of insertelement must be packed type.
+ return false; // First operand of insertelement must be vector type.
if (Elt->getType() != cast<VectorType>(Vec->getType())->getElementType())
return false;// Second operand of insertelement must be packed element type.
diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp
index b70b7c5..da5cdb7 100644
--- a/lib/VMCore/Type.cpp
+++ b/lib/VMCore/Type.cpp
@@ -110,7 +110,7 @@
if (!this->isFirstClassType() || !Ty->isFirstClassType())
return false;
- // Packed -> Packed conversions are always lossless if the two packed types
+ // Vector -> Vector conversions are always lossless if the two vector types
// have the same size, otherwise not.
if (const VectorType *thisPTy = dyn_cast<VectorType>(this))
if (const VectorType *thatPTy = dyn_cast<VectorType>(Ty))
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp
index 484dfd1..bf9ebea 100644
--- a/lib/VMCore/Verifier.cpp
+++ b/lib/VMCore/Verifier.cpp
@@ -720,7 +720,7 @@
&B);
Assert1(B.getType()->isInteger() || B.getType()->isFloatingPoint() ||
isa<VectorType>(B.getType()),
- "Arithmetic operators must have integer, fp, or packed type!", &B);
+ "Arithmetic operators must have integer, fp, or vector type!", &B);
break;
}