[PATCH] D89371: [NPM] Port -loop-versioning-licm to NPM

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 14 11:00:18 PDT 2020


aeubanks added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LoopVersioningLICM.cpp:148
+  LoopVersioningLICM(AliasAnalysis *AA, ScalarEvolution *SE,
+                     LoopAccessLegacyAnalysis *LAA, LoopAccessInfo *LAI,
+                     OptimizationRemarkEmitter *ORE)
----------------
TaWeiTu wrote:
> aeubanks wrote:
> > aeubanks wrote:
> > > is the `LoopAccessLegacyAnalysis` necessary? Can `LoopVersioningLICM` only need the `LoopAccessInfo` passed in from callers? Looks like both the legacy and NPM pass can create the proper `LoopAccessInfo`.
> > I meant can we can treat `LoopAccessInfo` just like the other analyses like `DominatorTree`?
> > Creating it inside `LoopVersioningLICMPass::run`/`LoopVersioningLICMLegacyPass::runOnLoop` rather than passing a `function_ref`. So `GetLAI` is unnecessary.
> The reason I used `GetLAI` in the first place is that we might hit an early return with instructions that are not safe for versioning and we don't need to analyze the whole loop in this case.
> What's your opinion on this? Thanks!
Ah that makes sense, sgtm. A comment would be good.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89371



More information about the llvm-commits mailing list