mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
86eb682529
Summary: This is last in of a series of patches to evolve ADCE.cpp to support removing of unnecessary control flow. This patch adds the code to update the control and data flow graphs to remove the dead control flow. Also update unit tests to test the capability to remove dead, may-be-infinite loop which is enabled by the switch -adce-remove-loops. Previous patches: D23824 [ADCE] Add handling of PHI nodes when removing control flow D23559 [ADCE] Add control dependence computation D23225 [ADCE] Modify data structures to support removing control flow D23065 [ADCE] Refactor anticipating new functionality (NFC) D23102 [ADCE] Refactoring for new functionality (NFC) Reviewers: dberlin, majnemer, nadav, mehdi_amini Subscribers: llvm-commits, david2050, freik, twoh Differential Revision: https://reviews.llvm.org/D24918 llvm-svn: 289548
18 lines
446 B
LLVM
18 lines
446 B
LLVM
; RUN: opt < %s -adce -disable-output
|
|
; RUN: opt < %s -adce -adce-remove-loops -disable-output
|
|
|
|
define void @test() {
|
|
entry:
|
|
br label %UnifiedReturnBlock
|
|
|
|
UnifiedReturnBlock: ; preds = %invoke_catch.0, %entry
|
|
ret void
|
|
|
|
invoke_catch.0: ; No predecessors!
|
|
br i1 false, label %UnifiedUnwindBlock, label %UnifiedReturnBlock
|
|
|
|
UnifiedUnwindBlock: ; preds = %invoke_catch.0
|
|
unreachable
|
|
}
|
|
|