[PATCH] D98509: [LV] Calculate max feasible scalable VF.

Hubert Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 2 18:29:34 PDT 2021


hubert.reinterpretcast added a comment.

In D98509#2725892 <https://reviews.llvm.org/D98509#2725892>, @hubert.reinterpretcast wrote:

> In D98509#2725672 <https://reviews.llvm.org/D98509#2725672>, @sdesmalen wrote:
>
>> Reverting the patch for a few days is fine, I've pushed rG51d648c119d7773ce6fb809353bd6bd14bca8818 <https://reviews.llvm.org/rG51d648c119d7773ce6fb809353bd6bd14bca8818> for now.
>
> Thank you! Our internal CI is green again. I'll update with the investigation progress once it gets to a meaningful point.

I haven't reached the root cause yet, but it appears that the issue we're hitting can be avoided if the `MaxSafeVF` parameter is made pass-by-reference instead of pass-by-value.
@sdesmalen, I hope the following is not too intrusive a change to your patch.

  diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  index 2b413fc4950..ec3eb32cbe6 100644
  --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  @@ -1639,7 +1639,7 @@ private:
     ElementCount getMaximizedVFForTarget(unsigned ConstTripCount,
                                          unsigned SmallestType,
                                          unsigned WidestType,
  -                                       ElementCount MaxSafeVF);
  +                                       const ElementCount &MaxSafeVF);
  
     /// \return the maximum legal scalable VF, based on the safe max number
     /// of elements.
  @@ -5863,7 +5863,7 @@ LoopVectorizationCostModel::computeMaxVF(ElementCount UserVF, unsigned UserIC) {
  
   ElementCount LoopVectorizationCostModel::getMaximizedVFForTarget(
       unsigned ConstTripCount, unsigned SmallestType, unsigned WidestType,
  -    ElementCount MaxSafeVF) {
  +    const ElementCount &MaxSafeVF) {
     bool ComputeScalableMaxVF = MaxSafeVF.isScalable();
     TypeSize WidestRegister = TTI.getRegisterBitWidth(
         ComputeScalableMaxVF ? TargetTransformInfo::RGK_ScalableVector


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98509



More information about the llvm-commits mailing list