[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp LowerPacked.cpp Reassociate.cpp SCCP.cpp ScalarReplAggregates.cpp
Reid Spencer
reid at x10sys.com
Wed Feb 14 18:27:24 PST 2007
Changes in directory llvm/lib/Transforms/Scalar:
InstructionCombining.cpp updated: 1.632 -> 1.633
LowerPacked.cpp updated: 1.17 -> 1.18
Reassociate.cpp updated: 1.75 -> 1.76
SCCP.cpp updated: 1.162 -> 1.163
ScalarReplAggregates.cpp updated: 1.73 -> 1.74
---
Log message:
For PR1195: http://llvm.org/PR1195 :
Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and
PackedTyID -> VectorTyID. No functional changes.
---
Diffs of the changes: (+69 -69)
InstructionCombining.cpp | 62 +++++++++++++++++++++++------------------------
LowerPacked.cpp | 38 ++++++++++++++--------------
Reassociate.cpp | 2 -
SCCP.cpp | 8 +++---
ScalarReplAggregates.cpp | 28 ++++++++++-----------
5 files changed, 69 insertions(+), 69 deletions(-)
Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.632 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.633
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.632 Tue Feb 13 23:52:17 2007
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Wed Feb 14 20:26:10 2007
@@ -1262,7 +1262,7 @@
Value *InstCombiner::SimplifyDemandedVectorElts(Value *V, uint64_t DemandedElts,
uint64_t &UndefElts,
unsigned Depth) {
- unsigned VWidth = cast<PackedType>(V->getType())->getNumElements();
+ unsigned VWidth = cast<VectorType>(V->getType())->getNumElements();
assert(VWidth <= 64 && "Vector too wide to analyze!");
uint64_t EltMask = ~0ULL >> (64-VWidth);
assert(DemandedElts != EltMask && (DemandedElts & ~EltMask) == 0 &&
@@ -1278,8 +1278,8 @@
}
UndefElts = 0;
- if (ConstantPacked *CP = dyn_cast<ConstantPacked>(V)) {
- const Type *EltTy = cast<PackedType>(V->getType())->getElementType();
+ if (ConstantVector *CP = dyn_cast<ConstantVector>(V)) {
+ const Type *EltTy = cast<VectorType>(V->getType())->getElementType();
Constant *Undef = UndefValue::get(EltTy);
std::vector<Constant*> Elts;
@@ -1295,19 +1295,19 @@
}
// If we changed the constant, return it.
- Constant *NewCP = ConstantPacked::get(Elts);
+ Constant *NewCP = ConstantVector::get(Elts);
return NewCP != CP ? NewCP : 0;
} else if (isa<ConstantAggregateZero>(V)) {
- // Simplify the CAZ to a ConstantPacked where the non-demanded elements are
+ // Simplify the CAZ to a ConstantVector where the non-demanded elements are
// set to undef.
- const Type *EltTy = cast<PackedType>(V->getType())->getElementType();
+ const Type *EltTy = cast<VectorType>(V->getType())->getElementType();
Constant *Zero = Constant::getNullValue(EltTy);
Constant *Undef = UndefValue::get(EltTy);
std::vector<Constant*> Elts;
for (unsigned i = 0; i != VWidth; ++i)
Elts.push_back((DemandedElts & (1ULL << i)) ? Zero : Undef);
UndefElts = DemandedElts ^ EltMask;
- return ConstantPacked::get(Elts);
+ return ConstantVector::get(Elts);
}
if (!V->hasOneUse()) { // Other users may use these bits.
@@ -1743,7 +1743,7 @@
// See if SimplifyDemandedBits can simplify this. This handles stuff like
// (X & 254)+1 -> (X&254)|1
uint64_t KnownZero, KnownOne;
- if (!isa<PackedType>(I.getType()) &&
+ if (!isa<VectorType>(I.getType()) &&
SimplifyDemandedBits(&I, cast<IntegerType>(I.getType())->getBitMask(),
KnownZero, KnownOne))
return &I;
@@ -3064,12 +3064,12 @@
// See if we can simplify any instructions used by the instruction whose sole
// purpose is to compute bits we don't care about.
uint64_t KnownZero, KnownOne;
- if (!isa<PackedType>(I.getType())) {
+ if (!isa<VectorType>(I.getType())) {
if (SimplifyDemandedBits(&I, cast<IntegerType>(I.getType())->getBitMask(),
KnownZero, KnownOne))
return &I;
} else {
- if (ConstantPacked *CP = dyn_cast<ConstantPacked>(Op1)) {
+ if (ConstantVector *CP = dyn_cast<ConstantVector>(Op1)) {
if (CP->isAllOnesValue())
return ReplaceInstUsesWith(I, I.getOperand(0));
}
@@ -3543,7 +3543,7 @@
// See if we can simplify any instructions used by the instruction whose sole
// purpose is to compute bits we don't care about.
uint64_t KnownZero, KnownOne;
- if (!isa<PackedType>(I.getType()) &&
+ if (!isa<VectorType>(I.getType()) &&
SimplifyDemandedBits(&I, cast<IntegerType>(I.getType())->getBitMask(),
KnownZero, KnownOne))
return &I;
@@ -3874,7 +3874,7 @@
// See if we can simplify any instructions used by the instruction whose sole
// purpose is to compute bits we don't care about.
uint64_t KnownZero, KnownOne;
- if (!isa<PackedType>(I.getType()) &&
+ if (!isa<VectorType>(I.getType()) &&
SimplifyDemandedBits(&I, cast<IntegerType>(I.getType())->getBitMask(),
KnownZero, KnownOne))
return &I;
@@ -6460,8 +6460,8 @@
if (SVI->hasOneUse()) {
// Okay, we have (bitconvert (shuffle ..)). Check to see if this is
// a bitconvert to a vector with the same # elts.
- if (isa<PackedType>(DestTy) &&
- cast<PackedType>(DestTy)->getNumElements() ==
+ if (isa<VectorType>(DestTy) &&
+ cast<VectorType>(DestTy)->getNumElements() ==
SVI->getType()->getNumElements()) {
CastInst *Tmp;
// If either of the operands is a cast from CI.getType(), then
@@ -7082,7 +7082,7 @@
case Intrinsic::ppc_altivec_vperm:
// Turn vperm(V1,V2,mask) -> shuffle(V1,V2,mask) if mask is a constant.
- if (ConstantPacked *Mask = dyn_cast<ConstantPacked>(II->getOperand(3))) {
+ if (ConstantVector *Mask = dyn_cast<ConstantVector>(II->getOperand(3))) {
assert(Mask->getNumOperands() == 16 && "Bad type for intrinsic!");
// Check that all of the elements are integer constants or undefs.
@@ -8037,7 +8037,7 @@
const Type *SrcPTy = SrcTy->getElementType();
if (DestPTy->isInteger() || isa<PointerType>(DestPTy) ||
- isa<PackedType>(DestPTy)) {
+ isa<VectorType>(DestPTy)) {
// If the source is an array, the code below will not succeed. Check to
// see if a trivial 'gep P, 0, 0' will help matters. Only do this for
// constants.
@@ -8052,7 +8052,7 @@
}
if ((SrcPTy->isInteger() || isa<PointerType>(SrcPTy) ||
- isa<PackedType>(SrcPTy)) &&
+ isa<VectorType>(SrcPTy)) &&
// Do not allow turning this into a load of an integer, which is then
// casted to a pointer, this pessimizes pointer analysis a lot.
(isa<PointerType>(SrcPTy) == isa<PointerType>(LI.getType())) &&
@@ -8516,7 +8516,7 @@
static bool CheapToScalarize(Value *V, bool isConstant) {
if (isa<ConstantAggregateZero>(V))
return true;
- if (ConstantPacked *C = dyn_cast<ConstantPacked>(V)) {
+ if (ConstantVector *C = dyn_cast<ConstantVector>(V)) {
if (isConstant) return true;
// If all elts are the same, we can extract.
Constant *Op0 = C->getOperand(0);
@@ -8561,7 +8561,7 @@
return std::vector<unsigned>(NElts, 2*NElts);
std::vector<unsigned> Result;
- const ConstantPacked *CP = cast<ConstantPacked>(SVI->getOperand(2));
+ const ConstantVector *CP = cast<ConstantVector>(SVI->getOperand(2));
for (unsigned i = 0, e = CP->getNumOperands(); i != e; ++i)
if (isa<UndefValue>(CP->getOperand(i)))
Result.push_back(NElts*2); // undef -> 8
@@ -8574,8 +8574,8 @@
/// value is already around as a register, for example if it were inserted then
/// extracted from the vector.
static Value *FindScalarElement(Value *V, unsigned EltNo) {
- assert(isa<PackedType>(V->getType()) && "Not looking at a vector?");
- const PackedType *PTy = cast<PackedType>(V->getType());
+ assert(isa<VectorType>(V->getType()) && "Not looking at a vector?");
+ const VectorType *PTy = cast<VectorType>(V->getType());
unsigned Width = PTy->getNumElements();
if (EltNo >= Width) // Out of range access.
return UndefValue::get(PTy->getElementType());
@@ -8584,7 +8584,7 @@
return UndefValue::get(PTy->getElementType());
else if (isa<ConstantAggregateZero>(V))
return Constant::getNullValue(PTy->getElementType());
- else if (ConstantPacked *CP = dyn_cast<ConstantPacked>(V))
+ else if (ConstantVector *CP = dyn_cast<ConstantVector>(V))
return CP->getOperand(EltNo);
else if (InsertElementInst *III = dyn_cast<InsertElementInst>(V)) {
// If this is an insert to a variable element, we don't know what it is.
@@ -8624,7 +8624,7 @@
if (isa<ConstantAggregateZero>(EI.getOperand(0)))
return ReplaceInstUsesWith(EI, Constant::getNullValue(EI.getType()));
- if (ConstantPacked *C = dyn_cast<ConstantPacked>(EI.getOperand(0))) {
+ if (ConstantVector *C = dyn_cast<ConstantVector>(EI.getOperand(0))) {
// If packed val is constant with uniform operands, replace EI
// with that operand
Constant *op0 = C->getOperand(0);
@@ -8724,7 +8724,7 @@
std::vector<Constant*> &Mask) {
assert(V->getType() == LHS->getType() && V->getType() == RHS->getType() &&
"Invalid CollectSingleShuffleElements");
- unsigned NumElts = cast<PackedType>(V->getType())->getNumElements();
+ unsigned NumElts = cast<VectorType>(V->getType())->getNumElements();
if (isa<UndefValue>(V)) {
Mask.assign(NumElts, UndefValue::get(Type::Int32Ty));
@@ -8792,10 +8792,10 @@
/// that computes V and the LHS value of the shuffle.
static Value *CollectShuffleElements(Value *V, std::vector<Constant*> &Mask,
Value *&RHS) {
- assert(isa<PackedType>(V->getType()) &&
+ assert(isa<VectorType>(V->getType()) &&
(RHS == 0 || V->getType() == RHS->getType()) &&
"Invalid shuffle!");
- unsigned NumElts = cast<PackedType>(V->getType())->getNumElements();
+ unsigned NumElts = cast<VectorType>(V->getType())->getNumElements();
if (isa<UndefValue>(V)) {
Mask.assign(NumElts, UndefValue::get(Type::Int32Ty));
@@ -8895,7 +8895,7 @@
}
Mask[InsertedIdx] = ConstantInt::get(Type::Int32Ty, ExtractedIdx);
return new ShuffleVectorInst(EI->getOperand(0), VecOp,
- ConstantPacked::get(Mask));
+ ConstantVector::get(Mask));
}
// If this insertelement isn't used by some other insertelement, turn it
@@ -8906,7 +8906,7 @@
Value *LHS = CollectShuffleElements(&IE, Mask, RHS);
if (RHS == 0) RHS = UndefValue::get(LHS->getType());
// We now have a shuffle of LHS, RHS, Mask.
- return new ShuffleVectorInst(LHS, RHS, ConstantPacked::get(Mask));
+ return new ShuffleVectorInst(LHS, RHS, ConstantVector::get(Mask));
}
}
}
@@ -8947,7 +8947,7 @@
else
Elts.push_back(ConstantInt::get(Type::Int32Ty, Mask[i]));
}
- SVI.setOperand(2, ConstantPacked::get(Elts));
+ SVI.setOperand(2, ConstantVector::get(Elts));
}
}
@@ -8975,7 +8975,7 @@
}
SVI.setOperand(0, SVI.getOperand(1));
SVI.setOperand(1, UndefValue::get(RHS->getType()));
- SVI.setOperand(2, ConstantPacked::get(Elts));
+ SVI.setOperand(2, ConstantVector::get(Elts));
LHS = SVI.getOperand(0);
RHS = SVI.getOperand(1);
MadeChange = true;
@@ -9030,7 +9030,7 @@
}
return new ShuffleVectorInst(LHSSVI->getOperand(0),
LHSSVI->getOperand(1),
- ConstantPacked::get(Elts));
+ ConstantVector::get(Elts));
}
}
}
Index: llvm/lib/Transforms/Scalar/LowerPacked.cpp
diff -u llvm/lib/Transforms/Scalar/LowerPacked.cpp:1.17 llvm/lib/Transforms/Scalar/LowerPacked.cpp:1.18
--- llvm/lib/Transforms/Scalar/LowerPacked.cpp:1.17 Mon Feb 12 16:56:41 2007
+++ llvm/lib/Transforms/Scalar/LowerPacked.cpp Wed Feb 14 20:26:10 2007
@@ -72,13 +72,13 @@
/// @param EI the insertelement operator to convert
void visitInsertElementInst(InsertElementInst& IE);
- /// This function asserts if the instruction is a PackedType but
+ /// This function asserts if the instruction is a VectorType but
/// is handled by another function.
///
- /// @brief Asserts if PackedType instruction is not handled elsewhere.
+ /// @brief Asserts if VectorType instruction is not handled elsewhere.
/// @param I the unhandled instruction
void visitInstruction(Instruction &I) {
- if (isa<PackedType>(I.getType()))
+ if (isa<VectorType>(I.getType()))
cerr << "Unhandled Instruction with Packed ReturnType: " << I << '\n';
}
private:
@@ -150,8 +150,8 @@
// the program.
std::vector<Value*>& LowerPacked::getValues(Value* value)
{
- assert(isa<PackedType>(value->getType()) &&
- "Value must be PackedType");
+ assert(isa<VectorType>(value->getType()) &&
+ "Value must be VectorType");
// reject further processing if this one has
// already been handled
@@ -161,7 +161,7 @@
return it->second;
}
- if (ConstantPacked* CP = dyn_cast<ConstantPacked>(value)) {
+ if (ConstantVector* CP = dyn_cast<ConstantVector>(value)) {
// non-zero constant case
std::vector<Value*> results;
results.reserve(CP->getNumOperands());
@@ -174,7 +174,7 @@
else if (ConstantAggregateZero* CAZ =
dyn_cast<ConstantAggregateZero>(value)) {
// zero constant
- const PackedType* PKT = cast<PackedType>(CAZ->getType());
+ const VectorType* PKT = cast<VectorType>(CAZ->getType());
std::vector<Value*> results;
results.reserve(PKT->getNumElements());
@@ -187,7 +187,7 @@
}
else if (isa<Instruction>(value)) {
// foward reference
- const PackedType* PKT = cast<PackedType>(value->getType());
+ const VectorType* PKT = cast<VectorType>(value->getType());
std::vector<Value*> results;
results.reserve(PKT->getNumElements());
@@ -200,7 +200,7 @@
else {
// we don't know what it is, and we are trying to retrieve
// a value for it
- assert(false && "Unhandled PackedType value");
+ assert(false && "Unhandled VectorType value");
abort();
}
}
@@ -208,7 +208,7 @@
void LowerPacked::visitLoadInst(LoadInst& LI)
{
// Make sure what we are dealing with is a packed type
- if (const PackedType* PKT = dyn_cast<PackedType>(LI.getType())) {
+ if (const VectorType* PKT = dyn_cast<VectorType>(LI.getType())) {
// Initialization, Idx is needed for getelementptr needed later
std::vector<Value*> Idx(2);
Idx[0] = ConstantInt::get(Type::Int32Ty,0);
@@ -249,8 +249,8 @@
void LowerPacked::visitBinaryOperator(BinaryOperator& BO)
{
- // Make sure both operands are PackedTypes
- if (isa<PackedType>(BO.getOperand(0)->getType())) {
+ // Make sure both operands are VectorTypes
+ if (isa<VectorType>(BO.getOperand(0)->getType())) {
std::vector<Value*>& op0Vals = getValues(BO.getOperand(0));
std::vector<Value*>& op1Vals = getValues(BO.getOperand(1));
std::vector<Value*> result;
@@ -277,8 +277,8 @@
void LowerPacked::visitICmpInst(ICmpInst& IC)
{
- // Make sure both operands are PackedTypes
- if (isa<PackedType>(IC.getOperand(0)->getType())) {
+ // Make sure both operands are VectorTypes
+ if (isa<VectorType>(IC.getOperand(0)->getType())) {
std::vector<Value*>& op0Vals = getValues(IC.getOperand(0));
std::vector<Value*>& op1Vals = getValues(IC.getOperand(1));
std::vector<Value*> result;
@@ -306,8 +306,8 @@
void LowerPacked::visitStoreInst(StoreInst& SI)
{
- if (const PackedType* PKT =
- dyn_cast<PackedType>(SI.getOperand(0)->getType())) {
+ if (const VectorType* PKT =
+ dyn_cast<VectorType>(SI.getOperand(0)->getType())) {
// We will need this for getelementptr
std::vector<Value*> Idx(2);
Idx[0] = ConstantInt::get(Type::Int32Ty,0);
@@ -343,8 +343,8 @@
void LowerPacked::visitSelectInst(SelectInst& SELI)
{
- // Make sure both operands are PackedTypes
- if (isa<PackedType>(SELI.getType())) {
+ // Make sure both operands are VectorTypes
+ if (isa<VectorType>(SELI.getType())) {
std::vector<Value*>& op0Vals = getValues(SELI.getTrueValue());
std::vector<Value*>& op1Vals = getValues(SELI.getFalseValue());
std::vector<Value*> result;
@@ -369,7 +369,7 @@
void LowerPacked::visitExtractElementInst(ExtractElementInst& EI)
{
std::vector<Value*>& op0Vals = getValues(EI.getOperand(0));
- const PackedType *PTy = cast<PackedType>(EI.getOperand(0)->getType());
+ const VectorType *PTy = cast<VectorType>(EI.getOperand(0)->getType());
Value *op1 = EI.getOperand(1);
if (ConstantInt *C = dyn_cast<ConstantInt>(op1)) {
Index: llvm/lib/Transforms/Scalar/Reassociate.cpp
diff -u llvm/lib/Transforms/Scalar/Reassociate.cpp:1.75 llvm/lib/Transforms/Scalar/Reassociate.cpp:1.76
--- llvm/lib/Transforms/Scalar/Reassociate.cpp:1.75 Sat Feb 10 19:23:03 2007
+++ llvm/lib/Transforms/Scalar/Reassociate.cpp Wed Feb 14 20:26:10 2007
@@ -752,7 +752,7 @@
// Reject cases where it is pointless to do this.
if (!isa<BinaryOperator>(BI) || BI->getType()->isFloatingPoint() ||
- isa<PackedType>(BI->getType()))
+ isa<VectorType>(BI->getType()))
continue; // Floating point ops are not associative.
// If this is a subtract instruction which is not already in negate form,
Index: llvm/lib/Transforms/Scalar/SCCP.cpp
diff -u llvm/lib/Transforms/Scalar/SCCP.cpp:1.162 llvm/lib/Transforms/Scalar/SCCP.cpp:1.163
--- llvm/lib/Transforms/Scalar/SCCP.cpp:1.162 Mon Feb 5 17:32:05 2007
+++ llvm/lib/Transforms/Scalar/SCCP.cpp Wed Feb 14 20:26:10 2007
@@ -702,8 +702,8 @@
// Could annihilate value.
if (I.getOpcode() == Instruction::And)
markConstant(IV, &I, Constant::getNullValue(I.getType()));
- else if (const PackedType *PT = dyn_cast<PackedType>(I.getType()))
- markConstant(IV, &I, ConstantPacked::getAllOnesValue(PT));
+ else if (const VectorType *PT = dyn_cast<VectorType>(I.getType()))
+ markConstant(IV, &I, ConstantVector::getAllOnesValue(PT));
else
markConstant(IV, &I, ConstantInt::getAllOnesValue(I.getType()));
return;
@@ -1237,8 +1237,8 @@
case Instruction::Or:
// undef | X -> -1. X could be -1.
- if (const PackedType *PTy = dyn_cast<PackedType>(ITy))
- markForcedConstant(LV, I, ConstantPacked::getAllOnesValue(PTy));
+ if (const VectorType *PTy = dyn_cast<VectorType>(ITy))
+ markForcedConstant(LV, I, ConstantVector::getAllOnesValue(PTy));
else
markForcedConstant(LV, I, ConstantInt::getAllOnesValue(ITy));
return true;
Index: llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp
diff -u llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.73 llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.74
--- llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.73 Mon Feb 12 16:56:41 2007
+++ llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp Wed Feb 14 20:26:10 2007
@@ -323,12 +323,12 @@
//
// Scalar replacing *just* the outer index of the array is probably not
// going to be a win anyway, so just give up.
- for (++I; I != E && (isa<ArrayType>(*I) || isa<PackedType>(*I)); ++I) {
+ for (++I; I != E && (isa<ArrayType>(*I) || isa<VectorType>(*I)); ++I) {
uint64_t NumElements;
if (const ArrayType *SubArrayTy = dyn_cast<ArrayType>(*I))
NumElements = SubArrayTy->getNumElements();
else
- NumElements = cast<PackedType>(*I)->getNumElements();
+ NumElements = cast<VectorType>(*I)->getNumElements();
if (!isa<ConstantInt>(I.getOperand())) return 0;
if (cast<ConstantInt>(I.getOperand())->getZExtValue() >= NumElements)
@@ -440,7 +440,7 @@
static bool MergeInType(const Type *In, const Type *&Accum,
const TargetData &TD) {
// If this is our first type, just use it.
- const PackedType *PTy;
+ const VectorType *PTy;
if (Accum == Type::VoidTy || In == Accum) {
Accum = In;
} else if (In == Type::VoidTy) {
@@ -452,16 +452,16 @@
Accum = In;
} else if (isa<PointerType>(In) && isa<PointerType>(Accum)) {
// Pointer unions just stay as one of the pointers.
- } else if (isa<PackedType>(In) || isa<PackedType>(Accum)) {
- if ((PTy = dyn_cast<PackedType>(Accum)) &&
+ } else if (isa<VectorType>(In) || isa<VectorType>(Accum)) {
+ if ((PTy = dyn_cast<VectorType>(Accum)) &&
PTy->getElementType() == In) {
// Accum is a vector, and we are accessing an element: ok.
- } else if ((PTy = dyn_cast<PackedType>(In)) &&
+ } else if ((PTy = dyn_cast<VectorType>(In)) &&
PTy->getElementType() == Accum) {
// In is a vector, and accum is an element: ok, remember In.
Accum = In;
- } else if ((PTy = dyn_cast<PackedType>(In)) && isa<PackedType>(Accum) &&
- PTy->getBitWidth() == cast<PackedType>(Accum)->getBitWidth()) {
+ } else if ((PTy = dyn_cast<VectorType>(In)) && isa<VectorType>(Accum) &&
+ PTy->getBitWidth() == cast<VectorType>(Accum)->getBitWidth()) {
// Two vectors of the same size: keep Accum.
} else {
// Cannot insert an short into a <4 x int> or handle
@@ -561,7 +561,7 @@
if (const ArrayType *ATy = dyn_cast<ArrayType>(AggTy)) {
if (Idx >= ATy->getNumElements()) return 0; // Out of range.
- } else if (const PackedType *PackedTy = dyn_cast<PackedType>(AggTy)) {
+ } else if (const VectorType *PackedTy = dyn_cast<VectorType>(AggTy)) {
// Getting an element of the packed vector.
if (Idx >= PackedTy->getNumElements()) return 0; // Out of range.
@@ -630,7 +630,7 @@
/// Offset is an offset from the original alloca, in bits that need to be
/// shifted to the right. By the end of this, there should be no uses of Ptr.
void SROA::ConvertUsesToScalar(Value *Ptr, AllocaInst *NewAI, unsigned Offset) {
- bool isVectorInsert = isa<PackedType>(NewAI->getType()->getElementType());
+ bool isVectorInsert = isa<VectorType>(NewAI->getType()->getElementType());
const TargetData &TD = getAnalysis<TargetData>();
while (!Ptr->use_empty()) {
Instruction *User = cast<Instruction>(Ptr->use_back());
@@ -639,10 +639,10 @@
// The load is a bit extract from NewAI shifted right by Offset bits.
Value *NV = new LoadInst(NewAI, LI->getName(), LI);
if (NV->getType() != LI->getType()) {
- if (const PackedType *PTy = dyn_cast<PackedType>(NV->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 (isa<PackedType>(LI->getType())) {
+ if (isa<VectorType>(LI->getType())) {
NV = new BitCastInst(NV, LI->getType(), LI->getName(), LI);
} else {
// Must be an element access.
@@ -702,10 +702,10 @@
if (SV->getType() != AllocaType) {
Value *Old = new LoadInst(NewAI, NewAI->getName()+".in", SI);
- if (const PackedType *PTy = dyn_cast<PackedType>(AllocaType)) {
+ 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 (isa<PackedType>(SV->getType())) {
+ if (isa<VectorType>(SV->getType())) {
SV = new BitCastInst(SV, AllocaType, SV->getName(), SI);
} else {
// Must be an element insertion.
More information about the llvm-commits
mailing list