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

Ta-Wei Tu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 14 10:55:59 PDT 2020


TaWeiTu added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LoopVersioningLICM.cpp:148
+  LoopVersioningLICM(AliasAnalysis *AA, ScalarEvolution *SE,
+                     LoopAccessLegacyAnalysis *LAA, LoopAccessInfo *LAI,
+                     OptimizationRemarkEmitter *ORE)
----------------
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!


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