[PATCH] D134173: [LoopFuse] Drop loop dispositions before reassigning blocks to other loop

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 19 03:44:22 PDT 2022


nikic added a comment.

In D134173#3799177 <https://reviews.llvm.org/D134173#3799177>, @fhahn wrote:

> In D134173#3799159 <https://reviews.llvm.org/D134173#3799159>, @mkazantsev wrote:
>
>> Keeping drop of these loop dispositions as a separate call generally looks increasingly annoying... I'll see if there is a way to get rid of it.
>
> Hmm, would it make sense to forget loop dispositions as part of forgetLoop? Having to clean them up separately is very easy to forget and also not really clear from the existing documentation.

forgetLoop() already clears loop dispositions for values it forgets -- but these are only the values based on loop header phis, so an explicit forgetLoopDispositions() is needed if the disposition of other values changes.

We can't easily clear all dispositions for a loop because of how these maps are indexed -- we can either efficiently clear dispositions for a SCEV or for a Loop, but not both at the same time. This is a recurring problem in SCEV, I wonder if it has some elegant solution. (We basically need a multi-key map where each key part can be efficiently invalidated.)


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

https://reviews.llvm.org/D134173



More information about the llvm-commits mailing list