[llvm] [SROA]: Only defer trying partial sized ptr or ptr vector types (PR #82279)
Jeffrey Byrnes via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 1 12:45:09 PST 2024
================
@@ -2257,6 +2257,38 @@ checkVectorTypesForPromotion(Partition &P, const DataLayout &DL,
return nullptr;
}
+static VectorType *createAndCheckVectorTypesForPromotion(
+ SetVector<Type *> &OtherTys,
+ SmallVectorImpl<VectorType *> &CandidateTysCopy,
+ function_ref<void(Type *)> CheckCandidateType, Partition &P,
+ const DataLayout &DL, SmallVector<VectorType *, 4> &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 *&VTy : CandidateTysCopy) {
----------------
jrbyrnes wrote:
Actually, this is causing a failure.
AFAICT, CandidateTys.push_back(VTy); under certain conditions is causing a change of the base address for CandidateTys. Then CandidateTysCopy points to garbage. I will change the PR
https://github.com/llvm/llvm-project/pull/82279
More information about the llvm-commits
mailing list