summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/ADCE/2003-01-22-PredecessorProblem.ll
diff options
context:
space:
mode:
authorDavid Callahan <dcallahan@fb.com>2016-12-13 16:42:18 +0000
committerDavid Callahan <dcallahan@fb.com>2016-12-13 16:42:18 +0000
commitebcf916c5aefb82814efeaf6582e31ee149c00f5 (patch)
tree0e817ba63686fbb6513d486721d3f5515f6d7a9b /llvm/test/Transforms/ADCE/2003-01-22-PredecessorProblem.ll
parent1647f3855fe517a47704d399a30984004e759e89 (diff)
downloadbcm5719-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/2003-01-22-PredecessorProblem.ll')
-rw-r--r--llvm/test/Transforms/ADCE/2003-01-22-PredecessorProblem.ll5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/test/Transforms/ADCE/2003-01-22-PredecessorProblem.ll b/llvm/test/Transforms/ADCE/2003-01-22-PredecessorProblem.ll
index 17003be9fb1..ac395de6d41 100644
--- a/llvm/test/Transforms/ADCE/2003-01-22-PredecessorProblem.ll
+++ b/llvm/test/Transforms/ADCE/2003-01-22-PredecessorProblem.ll
@@ -1,5 +1,6 @@
; Testcase reduced from 197.parser by bugpoint
; RUN: opt < %s -adce
+; RUN: opt < %s -adce -adce-remove-loops -S | FileCheck %s
define void @conjunction_prune() {
; <label>:0
@@ -7,16 +8,20 @@ define void @conjunction_prune() {
bb19: ; preds = %bb23, %bb22, %0
%reg205 = phi i8* [ null, %bb22 ], [ null, %bb23 ], [ null, %0 ] ; <i8*> [#uses=1]
+; CHECK: br label %bb22
br i1 false, label %bb21, label %bb22
bb21: ; preds = %bb19
%cast455 = bitcast i8* %reg205 to i8** ; <i8**> [#uses=0]
+; CHECK: br label %bb22
br label %bb22
bb22: ; preds = %bb21, %bb19
+; CHECK: br label %bb23
br i1 false, label %bb19, label %bb23
bb23: ; preds = %bb22
+; CHECK: br label %bb28
br i1 false, label %bb19, label %bb28
bb28: ; preds = %bb23
OpenPOWER on IntegriCloud