diff options
author | David Callahan <dcallahan@fb.com> | 2016-12-13 16:42:18 +0000 |
---|---|---|
committer | David Callahan <dcallahan@fb.com> | 2016-12-13 16:42:18 +0000 |
commit | ebcf916c5aefb82814efeaf6582e31ee149c00f5 (patch) | |
tree | 0e817ba63686fbb6513d486721d3f5515f6d7a9b /llvm/test/Transforms/ADCE/basictest2.ll | |
parent | 1647f3855fe517a47704d399a30984004e759e89 (diff) | |
download | bcm5719-llvm-ebcf916c5aefb82814efeaf6582e31ee149c00f5.tar.gz bcm5719-llvm-ebcf916c5aefb82814efeaf6582e31ee149c00f5.zip |
[ADCE] Add code to remove dead branches
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
Diffstat (limited to 'llvm/test/Transforms/ADCE/basictest2.ll')
-rw-r--r-- | llvm/test/Transforms/ADCE/basictest2.ll | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/test/Transforms/ADCE/basictest2.ll b/llvm/test/Transforms/ADCE/basictest2.ll index 26b2e85cccb..50336e18705 100644 --- a/llvm/test/Transforms/ADCE/basictest2.ll +++ b/llvm/test/Transforms/ADCE/basictest2.ll @@ -1,4 +1,6 @@ -; RUN: opt < %s -adce -simplifycfg | llvm-dis +; RUN: opt < %s -adce -disable-output +; RUN: opt < %s -adce -adce-remove-loops -S | FileCheck %s + %FILE = type { i32, i8*, i8*, i8, i8, i32, i32, i32 } %spec_fd_t = type { i32, i32, i32, i8* } @__iob = external global [20 x %FILE] ; <[20 x %FILE]*> [#uses=1] @@ -24,6 +26,7 @@ declare void @perror(i8*) define i32 @spec_getc(i32 %fd) { %reg109 = load i32, i32* @dbglvl ; <i32> [#uses=1] %cond266 = icmp sle i32 %reg109, 4 ; <i1> [#uses=1] +; CHECK: br label %bb3 br i1 %cond266, label %bb3, label %bb2 bb2: ; preds = %0 @@ -55,6 +58,7 @@ bb5: ; preds = %bb3 bb6: ; preds = %bb5 %reg134 = load i32, i32* @dbglvl ; <i32> [#uses=1] %cond271 = icmp sle i32 %reg134, 4 ; <i1> [#uses=1] +; CHECK: br label %bb8 br i1 %cond271, label %bb8, label %bb7 bb7: ; preds = %bb6 @@ -77,6 +81,7 @@ bb9: ; preds = %bb5 store i32 %reg157, i32* %idx5 %reg163 = load i32, i32* @dbglvl ; <i32> [#uses=1] %cond272 = icmp sle i32 %reg163, 4 ; <i1> [#uses=1] +; CHECK: br label %bb11 br i1 %cond272, label %bb11, label %bb10 bb10: ; preds = %bb9 |