[PATCH] D89665: [LSR] ignore profitable chain optimization when instruction number is the major cost

ChenZheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 21 17:49:55 PDT 2020


shchenz added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:2862
+  // chain as profitable.
   if (TTI.isProfitableLSRChainElement(Chain.Incs[0].UserInst))
     return true;
----------------
samparker wrote:
> You don't need this now :)
seems we still need this? The following loop does not contain the first element in the chain.
```
  // Return the first increment in the chain.
  const_iterator begin() const {
    assert(!Incs.empty());
    return std::next(Incs.begin());
  }
  const_iterator end() const {
    return Incs.end();
  }
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89665



More information about the llvm-commits mailing list