[llvm] [SROA]: Only defer trying partial sized ptr or ptr vector types (PR #82279)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 29 00:37:31 PST 2024
================
@@ -2257,6 +2257,37 @@ checkVectorTypesForPromotion(Partition &P, const DataLayout &DL,
return nullptr;
}
+static VectorType *createAndCheckVectorTypesForPromotion(
+ SetVector<Type *> &OtherTys, ArrayRef<VectorType *> CandidateTysCopy,
+ function_ref<void(Type *)> CheckCandidateType, Partition &P,
+ const DataLayout &DL, SmallVectorImpl<VectorType *> &CandidateTys,
+ bool &HaveCommonEltTy, Type *&CommonEltTy, bool &HaveVecPtrTy,
+ bool &HaveCommonVecPtrTy, VectorType *&CommonVecPtrTy) {
+ // Consider additional vector types where the element type size is a
+ // multiple of load/store element size.
+ for (Type *Ty : OtherTys) {
+ if (!VectorType::isValidElementType(Ty))
+ continue;
+ unsigned TypeSize = DL.getTypeSizeInBits(Ty).getFixedValue();
+ // Make a copy of CandidateTys and iterate through it, because we
+ // might append to CandidateTys in the loop.
+ for (VectorType *const &VTy : CandidateTysCopy) {
----------------
arsenm wrote:
This doesn't need to be a reference?
https://github.com/llvm/llvm-project/pull/82279
More information about the llvm-commits
mailing list