[PATCH] D109257: [SimpleLoopUnswitch] Inform pass manager when child loops are deleted

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 3 13:20:43 PDT 2021


bjope created this revision.
bjope added reviewers: aeubanks, asbirlea, jaykang10.
Herald added a subscriber: hiraditya.
bjope requested review of this revision.
Herald added a project: LLVM.

As part of the nontrivial unswitching we could end up removing child
loops. This patch add a notification to the pass manager when
that happens (using the markLoopAsDeleted callback).

Without this there could be stale LoopAccessAnalysis results cached
in the analysis manager. Those analysis results are cached based on
a Loop* as key. Since the BumpPtrAllocator used to allocate
Loop objects could be resetted between different runs of for
example the loop-distribute pass (running on different functions),
a new Loop object could be created using the same Loop pointer.
And then when requiring the LoopAccessAnalysis for the loop we
got the stale (corrupt) result from the destroyed loop.

Change-Id: Id976debe231ee6595752f501b36e719200834997


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D109257

Files:
  llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
  llvm/test/Transforms/SimpleLoopUnswitch/nontrivial-unswitch-markloopasdeleted.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109257.370661.patch
Type: text/x-patch
Size: 7918 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210903/c84a6b35/attachment.bin>


More information about the llvm-commits mailing list