[PATCH] D116660: [LoopFlatten] Update MemorySSA state

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 6 10:14:40 PST 2022


aeubanks added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LoopFlatten.cpp:824
 
+  Optional<MemorySSAUpdater> MSSAU;
+   if (AR.MSSA) {
----------------
fhahn wrote:
> SjoerdMeijer wrote:
> > SjoerdMeijer wrote:
> > > fhahn wrote:
> > > > Could `MSSAU` be created unconditionally like with the legacy pass manager?
> > > Thanks for taking a look.
> > > 
> > > I borrowed this boilerplate code from SimpleLoopUnswitch, but sure, I guess so and will add that.
> > > 
> > Hmm, I see this pattern used in most passes, like LoopRotation, LoopSimplifyCFG (SimpleLoopUnswitch).
> > 
> > For my understanding, what would be the benefit of doing this unconditionally?
> slightly less & more straight-forward code?
with the legacy PM it looks like we're unconditionally requesting MSSA (constructing it if it doesn't yet exist) and then updating it, which is wasted work if MSSA wasn't already available. we only want to keep MSSA up to date if it's already cached


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

https://reviews.llvm.org/D116660



More information about the llvm-commits mailing list