diff options
author | Florian Hahn <flo@fhahn.com> | 2022-09-30 11:21:58 +0100 |
---|---|---|
committer | Florian Hahn <flo@fhahn.com> | 2022-09-30 11:21:58 +0100 |
commit | 8ae0d9aa072643a7c596e147e3fc7ee0b4dede1f (patch) | |
tree | 99361ebad0825db6f51eedeba58a6a09bdec7fb3 /llvm/lib/Transforms/Utils/LoopUtils.cpp | |
parent | 19782a46f809c2343d225f7c5448132a9a4888e6 (diff) | |
download | llvm-8ae0d9aa072643a7c596e147e3fc7ee0b4dede1f.zip llvm-8ae0d9aa072643a7c596e147e3fc7ee0b4dede1f.tar.gz llvm-8ae0d9aa072643a7c596e147e3fc7ee0b4dede1f.tar.bz2 |
[LoopDeletion] Clear block & loop dispo cache after breaking backedge.
breakLoopBackedge may remove blocks and loops. Also clear block &
loop disposition to avoid the cache containing invalid blocks and loops.
The coverage for the change is provided when using an ASAN build of opt
to run the LoopDeletion unit tests; without the fix, pointers to invalid
objects would be used.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D134663
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUtils.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LoopUtils.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopUtils.cpp b/llvm/lib/Transforms/Utils/LoopUtils.cpp index 2cef827..888be82 100644 --- a/llvm/lib/Transforms/Utils/LoopUtils.cpp +++ b/llvm/lib/Transforms/Utils/LoopUtils.cpp @@ -696,6 +696,7 @@ void llvm::breakLoopBackedge(Loop *L, DominatorTree &DT, ScalarEvolution &SE, Loop *OutermostLoop = L->getOutermostLoop(); SE.forgetLoop(L); + SE.forgetBlockAndLoopDispositions(); std::unique_ptr<MemorySSAUpdater> MSSAU; if (MSSA) |