================ @@ -1011,6 +1011,31 @@ static Value *foldPHINodeOrSelectInst(Instruction &I) { return foldSelectInst(cast<SelectInst>(I)); } +/// Returns a fixed vector type equivalent to the memory set by II or nullptr if +/// unable to do so. +static FixedVectorType *getVectorTypeFor(const MemSetInst &II, + const DataLayout &DL) { + const ConstantInt *Length = dyn_cast<ConstantInt>(II.getLength()); + if (!Length) + return nullptr; + + APInt Val = Length->getValue(); + if (Val.ugt(std::numeric_limits<unsigned>::max())) + return nullptr; ---------------- macurtis-amd wrote:
I decided to move the limit from [checkVectorTypeForPromotion](https://github.com/llvm/llvm-project/blob/f4d25c498a20d73b9d3e4828023486a7b2591f38/llvm/lib/Transforms/Scalar/SROA.cpp#L2219) into a helper function and use it here. Let me know if there is a more sensible limit to use instead. https://github.com/llvm/llvm-project/pull/133301 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits