[all-commits] [llvm/llvm-project] f17d60: Inform pass manager when child loops are deleted

Björn Pettersson via All-commits all-commits at lists.llvm.org
Thu Sep 9 09:05:25 PDT 2021


  Branch: refs/heads/release/13.x
  Home:   https://github.com/llvm/llvm-project
  Commit: f17d60d620283b5d53286056ceeaeb8c27b6530a
      https://github.com/llvm/llvm-project/commit/f17d60d620283b5d53286056ceeaeb8c27b6530a
  Author: Bjorn Pettersson <bjorn.a.pettersson at ericsson.com>
  Date:   2021-09-09 (Thu, 09 Sep 2021)

  Changed paths:
    M llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
    A llvm/test/Transforms/SimpleLoopUnswitch/nontrivial-unswitch-markloopasdeleted.ll

  Log Message:
  -----------
  Inform pass manager when child loops are deleted

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.

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D109257

(fixes PR51754)
(cherry-picked from commit 0f0344dd1e3b53387bb396070916e67f4c426da6)




More information about the All-commits mailing list