[llvm] [LV] Change getSmallBestKnownTC to return an ElementCount (NFC) (PR #141793)

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 4 09:15:30 PDT 2025


================
@@ -427,24 +427,24 @@ static bool hasIrregularType(Type *Ty, const DataLayout &DL) {
 ///   2) Returns expected trip count according to profile data if any.
 ///   3) Returns upper bound estimate if known, and if \p CanUseConstantMax.
 ///   4) Returns std::nullopt if all of the above failed.
-static std::optional<unsigned>
+static std::optional<ElementCount>
 getSmallBestKnownTC(PredicatedScalarEvolution &PSE, Loop *L,
                     bool CanUseConstantMax = true) {
----------------
paulwalker-arm wrote:

I don't think so because there are other places within LoopVectorize where `getSmallConstantTripCount` is called that also require the ElementCount returning variant.

https://github.com/llvm/llvm-project/pull/141793


More information about the llvm-commits mailing list