[PATCH] D114528: [LV] Make sure VF doesn't exceed compile time known TC

Evgeniy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 3 03:46:56 PST 2021


ebrevnov added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:6085
+                         "exceeding the constant trip count: "
                       << ConstTripCount << "\n");
+    return ElementCount::getFixed(PowerOf2Floor(ConstTripCount));
----------------
dmgreen wrote:
> fhahn wrote:
> > Shouldn't this be `PowerOf2Floor(ConstTripCount)`? 
> I think this is saying "the trip count is "ConstTripCount", so we are rounding that down to a power of 2 (left as an exercise to the reader)."
> 
> It may be better to be clearer about the values it will use though. Having what it thinks the original ConstTripCount printed somewhere does sound useful.
> I think this is saying "the trip count is "ConstTripCount", so we are rounding that down to a power of 2 (left as an exercise to the reader)."
While I agree this is valid interpretation I did mean to provide resulting value. So the printing PowerOf2Floor(ConstTripCount) here sounds reasonable to me. Do you think we should change wording?

> 
> It may be better to be clearer about the values it will use though. Having what it thinks the original ConstTripCount printed somewhere does sound useful.
It is printed out at the beginning of computeFeasibleMaxVF.



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114528/new/

https://reviews.llvm.org/D114528



More information about the llvm-commits mailing list