llvm-project/llvm/lib/Transforms
Max Kazantsev bf6af8fbf0 [LoopSimplifyCFG] Change logic of dead loops removal to avoid hitting asserts
The function `LI.erase` has some invariants that need to be preserved when it
tries to remove a loop which is not the top-level loop. In particular, it
requires loop's preheader to be strictly in loop's parent. Our current logic
of deletion of dead blocks may erase the information about preheader before we
handle the loop, and therefore we may hit this assertion.

This patch changes the logic of loop deletion: we make them top-level loops
before we actually erase them. This allows us to trigger the simple branch of
`erase` logic which just detatches blocks from the loop and does not try to do
some complex stuff that need this invariant.

Thanks to @uabelho for reporting this!

Differential Revision: https://reviews.llvm.org/D57221
Reviewed By: fedor.sergeev

llvm-svn: 353813
2019-02-12 09:37:00 +00:00
..
AggressiveInstCombine Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Coroutines [opaque pointer types] Pass value type to LoadInst creation. 2019-02-01 20:44:24 +00:00
Hello Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
IPO [GlobalOpt] Simplify __cxa_atexit elimination 2019-02-09 09:18:37 +00:00
InstCombine [InstCombine] Fix matchRotate bug when one operand is a ConstantExpr shift 2019-02-11 19:26:27 +00:00
Instrumentation [InstrProf] Implement static profdata registration 2019-02-08 19:03:50 +00:00
ObjCARC [opaque pointer types] Pass function type for CallBase::setCalledFunction. 2019-02-01 20:44:54 +00:00
Scalar [LoopSimplifyCFG] Change logic of dead loops removal to avoid hitting asserts 2019-02-12 09:37:00 +00:00
Utils [NFC] Rename DontDeleteUselessPHIs --> KeepOneInputPHIs 2019-02-12 07:09:29 +00:00
Vectorize Refactor setAlreadyUnrolled() and setAlreadyVectorized(). 2019-02-11 19:45:44 +00:00
CMakeLists.txt Another try to commit 323321 (aggressive instruction combine). 2018-01-25 12:06:32 +00:00
LLVMBuild.txt Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00