llvm-project/llvm/lib
Chijun Sima 530484372b [Dominators] Make RemoveUnreachableBlocks return false if the BasicBlock is already awaiting deletion
Summary:
Previously, `removeUnreachableBlocks` still returns true (which indicates the CFG is changed) even when all the unreachable blocks found is awaiting deletion in the DDT class.
This makes code pattern like
```
// Code modified from lib/Transforms/Scalar/SimplifyCFGPass.cpp 
bool EverChanged = removeUnreachableBlocks(F, nullptr, DDT);
...
do {
    EverChanged = someMightHappenModifications();
    EverChanged |= removeUnreachableBlocks(F, nullptr, DDT);
  } while (EverChanged);
```
become a dead loop.
Fix this by detecting whether a BasicBlock is already awaiting deletion.

Reviewers: kuhar, brzycki, dmgreen, grosser, davide

Reviewed By: kuhar, brzycki

Subscribers: llvm-commits

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

llvm-svn: 338882
2018-08-03 12:45:29 +00:00
..
Analysis [InstSimplify] fold extracting from std::pair (2/2) 2018-08-03 05:39:48 +00:00
AsmParser [DEBUGINFO] Disable emission of the dwarf sections, but allow directives. 2018-08-01 19:38:20 +00:00
BinaryFormat [dwarfdump] Add pretty printer for accelerator table based on Atom. 2018-07-13 17:21:51 +00:00
Bitcode Remove trailing space 2018-07-30 19:41:25 +00:00
CodeGen [TargetLowering] Generalise BuildSDIV function 2018-08-03 10:00:54 +00:00
DebugInfo [DebugInfo/Verifier] Don't emit error for missing module in index 2018-08-03 12:01:43 +00:00
Demangle [itanium demangler] Support dot suffixes on block invocation functions 2018-08-02 17:45:01 +00:00
ExecutionEngine [ORC] Add a re-exports fallback definition generator. 2018-08-02 20:13:58 +00:00
FuzzMutate Remove trailing space 2018-07-30 19:41:25 +00:00
Fuzzer
IR [Dominators] Refine the logic of recalculate() in the DomTreeUpdater 2018-08-03 06:51:35 +00:00
IRReader LLParser: add an argument for overriding data layout and do not check alloca addr space 2018-01-30 22:32:39 +00:00
LTO Remove trailing space 2018-07-30 19:41:25 +00:00
LineEditor
Linker [NFC] Remove an empty line. 2018-07-27 06:50:45 +00:00
MC Fix "not all control paths return a value" MSVC warning. 2018-08-01 13:00:11 +00:00
Object Remove trailing space 2018-07-30 19:41:25 +00:00
ObjectYAML [CodeView] Minimal support for S_UNAMESPACE records 2018-07-31 19:15:50 +00:00
Option Re-revert "[Option] Fix PR37006 prefix choice in findNearest" 2018-05-19 16:21:01 +00:00
Passes Revert "[GVNHoist] Re-enable GVNHoist by default" 2018-07-30 20:07:33 +00:00
ProfileData [InstrProf] Use comdats on COFF for available_externally functions 2018-07-26 22:59:17 +00:00
Support [Windows FS] Allow moving files in TempFile::keep 2018-08-03 10:13:35 +00:00
TableGen Remove trailing space 2018-07-30 19:41:25 +00:00
Target [SystemZ] Improve handling of instructions which expand to several groups 2018-08-03 10:43:05 +00:00
Testing [LLVMTestingSupport] Add explicit linkage to LLVMSupport 2018-04-08 06:49:17 +00:00
ToolDrivers Give llvm-lib rudimentary help output. 2018-07-14 02:29:44 +00:00
Transforms [Dominators] Make RemoveUnreachableBlocks return false if the BasicBlock is already awaiting deletion 2018-08-03 12:45:29 +00:00
WindowsManifest Convert line endings of lib/WindowsManifest/CMakeLists.txt to unix. 2018-04-07 04:28:08 +00:00
XRay convert some tabs to spaces 2018-08-03 12:21:54 +00:00
CMakeLists.txt
LLVMBuild.txt