[llvm] 56eb755 - [SVE] Eliminate calls to default-false VectorType::get() from AArch64
Christopher Tetreault via llvm-commits
llvm-commits at lists.llvm.org
Fri May 29 15:39:51 PDT 2020
Author: Christopher Tetreault
Date: 2020-05-29T15:39:30-07:00
New Revision: 56eb7556e75ca022bfa9b4c6b60a9571b41e2447
URL: https://github.com/llvm/llvm-project/commit/56eb7556e75ca022bfa9b4c6b60a9571b41e2447
DIFF: https://github.com/llvm/llvm-project/commit/56eb7556e75ca022bfa9b4c6b60a9571b41e2447.diff
LOG: [SVE] Eliminate calls to default-false VectorType::get() from AArch64
Reviewers: efriedma, c-rhodes, david-arm, mcrosier, t.p.northover
Reviewed By: efriedma
Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, danielkiss, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80327
Added:
Modified:
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/lib/Target/AArch64/AArch64StackTagging.cpp
llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
index aece1d0da59a..dfa4b493c221 100644
--- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -9571,7 +9571,8 @@ bool AArch64TargetLowering::lowerInterleavedLoad(
// load integer vectors first and then convert to pointer vectors.
Type *EltTy = VecTy->getElementType();
if (EltTy->isPointerTy())
- VecTy = VectorType::get(DL.getIntPtrType(EltTy), VecTy->getNumElements());
+ VecTy =
+ FixedVectorType::get(DL.getIntPtrType(EltTy), VecTy->getNumElements());
IRBuilder<> Builder(LI);
@@ -9581,8 +9582,8 @@ bool AArch64TargetLowering::lowerInterleavedLoad(
if (NumLoads > 1) {
// If we're going to generate more than one load, reset the sub-vector type
// to something legal.
- VecTy = VectorType::get(VecTy->getElementType(),
- VecTy->getNumElements() / NumLoads);
+ VecTy = FixedVectorType::get(VecTy->getElementType(),
+ VecTy->getNumElements() / NumLoads);
// We will compute the pointer operand of each load from the original base
// address using GEPs. Cast the base address to a pointer to the scalar
@@ -9626,8 +9627,8 @@ bool AArch64TargetLowering::lowerInterleavedLoad(
// Convert the integer vector to pointer vector if the element is pointer.
if (EltTy->isPointerTy())
SubVec = Builder.CreateIntToPtr(
- SubVec, VectorType::get(SVI->getType()->getElementType(),
- VecTy->getNumElements()));
+ SubVec, FixedVectorType::get(SVI->getType()->getElementType(),
+ VecTy->getNumElements()));
SubVecs[SVI].push_back(SubVec);
}
}
@@ -9683,7 +9684,7 @@ bool AArch64TargetLowering::lowerInterleavedStore(StoreInst *SI,
unsigned LaneLen = VecTy->getNumElements() / Factor;
Type *EltTy = VecTy->getElementType();
- VectorType *SubVecTy = VectorType::get(EltTy, LaneLen);
+ auto *SubVecTy = FixedVectorType::get(EltTy, LaneLen);
const DataLayout &DL = SI->getModule()->getDataLayout();
@@ -9706,11 +9707,11 @@ bool AArch64TargetLowering::lowerInterleavedStore(StoreInst *SI,
unsigned NumOpElts = cast<VectorType>(Op0->getType())->getNumElements();
// Convert to the corresponding integer vector.
- Type *IntVecTy = VectorType::get(IntTy, NumOpElts);
+ auto *IntVecTy = FixedVectorType::get(IntTy, NumOpElts);
Op0 = Builder.CreatePtrToInt(Op0, IntVecTy);
Op1 = Builder.CreatePtrToInt(Op1, IntVecTy);
- SubVecTy = VectorType::get(IntTy, LaneLen);
+ SubVecTy = FixedVectorType::get(IntTy, LaneLen);
}
// The base address of the store.
@@ -9720,7 +9721,7 @@ bool AArch64TargetLowering::lowerInterleavedStore(StoreInst *SI,
// If we're going to generate more than one store, reset the lane length
// and sub-vector type to something legal.
LaneLen /= NumStores;
- SubVecTy = VectorType::get(SubVecTy->getElementType(), LaneLen);
+ SubVecTy = FixedVectorType::get(SubVecTy->getElementType(), LaneLen);
// We will compute the pointer operand of each store from the original base
// address using GEPs. Cast the base address to a pointer to the scalar
diff --git a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp
index 42f6bfb1940e..3339efda7d7c 100644
--- a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp
+++ b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp
@@ -256,8 +256,8 @@ class InitializerBuilder {
Type *EltTy = VecTy->getElementType();
if (EltTy->isPointerTy()) {
uint32_t EltSize = DL->getTypeSizeInBits(EltTy);
- Type *NewTy = VectorType::get(IntegerType::get(Ctx, EltSize),
- VecTy->getNumElements());
+ auto *NewTy = FixedVectorType::get(IntegerType::get(Ctx, EltSize),
+ VecTy->getNumElements());
V = IRB.CreatePointerCast(V, NewTy);
}
}
diff --git a/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp b/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
index f0961646c31f..ebe126e2b863 100644
--- a/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
+++ b/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
@@ -211,8 +211,8 @@ bool AArch64TTIImpl::isWideningInstruction(Type *DstTy, unsigned Opcode,
// A helper that returns a vector type from the given type. The number of
// elements in type Ty determine the vector width.
auto toVectorTy = [&](Type *ArgTy) {
- return VectorType::get(ArgTy->getScalarType(),
- cast<VectorType>(DstTy)->getNumElements());
+ return FixedVectorType::get(ArgTy->getScalarType(),
+ cast<VectorType>(DstTy)->getNumElements());
};
// Exit early if DstTy is not a vector type whose elements are at least
@@ -254,7 +254,7 @@ bool AArch64TTIImpl::isWideningInstruction(Type *DstTy, unsigned Opcode,
// Legalize the source type and ensure it can be used in a widening
// operation.
- Type *SrcTy = toVectorTy(Extend->getSrcTy());
+ auto *SrcTy = toVectorTy(Extend->getSrcTy());
auto SrcTyL = TLI->getTypeLegalizationCost(DL, SrcTy);
unsigned SrcElTySize = SrcTyL.second.getScalarSizeInBits();
if (!SrcTyL.second.isVector() || SrcElTySize != SrcTy->getScalarSizeInBits())
More information about the llvm-commits
mailing list