diff options
author | Serguei Katkov <serguei.katkov@azul.com> | 2018-02-05 07:56:43 +0000 |
---|---|---|
committer | Serguei Katkov <serguei.katkov@azul.com> | 2018-02-05 07:56:43 +0000 |
commit | 6e93980e8251213269aa3e314036d933e77e6f33 (patch) | |
tree | 1179dbb21653d6b076ef6a3ab126625dd514642f /llvm/test/Transforms/LoopUnswitch | |
parent | 6ff5eb5dd51e63f0244a3ec7fab76a9a7595659d (diff) | |
download | bcm5719-llvm-6e93980e8251213269aa3e314036d933e77e6f33.tar.gz bcm5719-llvm-6e93980e8251213269aa3e314036d933e77e6f33.zip |
[SimplifyCFG] Relax restriction for folding unconditional branches
The commit rL308422 introduces a restriction for folding unconditional
branches. Specifically if empty block with unconditional branch leads to
header of the loop then elimination of this basic block is prohibited.
However it seems this condition is redundantly strict.
If elimination of this basic block does not introduce more back edges
then we can eliminate this block.
The patch implements this relax of restriction.
Reviewers: efriedma, mcrosier, pacxx, hsung, davidxl
Reviewed By: pacxx
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D42691
llvm-svn: 324208
Diffstat (limited to 'llvm/test/Transforms/LoopUnswitch')
-rw-r--r-- | llvm/test/Transforms/LoopUnswitch/2015-06-17-Metadata.ll | 4 | ||||
-rw-r--r-- | llvm/test/Transforms/LoopUnswitch/infinite-loop.ll | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/llvm/test/Transforms/LoopUnswitch/2015-06-17-Metadata.ll b/llvm/test/Transforms/LoopUnswitch/2015-06-17-Metadata.ll index 8652829bc51..a215be9d487 100644 --- a/llvm/test/Transforms/LoopUnswitch/2015-06-17-Metadata.ll +++ b/llvm/test/Transforms/LoopUnswitch/2015-06-17-Metadata.ll @@ -16,7 +16,7 @@ for.body: ; preds = %for.inc, %for.body. %cmp1 = icmp eq i32 %a, 12345 br i1 %cmp1, label %if.then, label %if.else, !prof !0 ; CHECK: %cmp1 = icmp eq i32 %a, 12345 -; CHECK-NEXT: br i1 %cmp1, label %for.body.preheader.split.us, label %for.body.preheader.split, !prof !0 +; CHECK-NEXT: br i1 %cmp1, label %for.body.us, label %for.body, !prof !0 if.then: ; preds = %for.body ; CHECK: for.body.us: ; CHECK: add nsw i32 %{{.*}}, 123 @@ -53,7 +53,7 @@ entry: br label %for.body ;CHECK: entry: ;CHECK-NEXT: %cmp1 = icmp eq i32 1, 2 -;CHECK-NEXT: br i1 %cmp1, label %entry.split, label %for.cond.cleanup.split, !prof !1 +;CHECK-NEXT: br i1 %cmp1, label %for.body, label %for.cond.cleanup.split, !prof !1 ;CHECK: for.body: for.body: ; preds = %for.inc, %entry %inc.i = phi i32 [ 0, %entry ], [ %inc, %if.then ] diff --git a/llvm/test/Transforms/LoopUnswitch/infinite-loop.ll b/llvm/test/Transforms/LoopUnswitch/infinite-loop.ll index af8725b02a1..013355faf35 100644 --- a/llvm/test/Transforms/LoopUnswitch/infinite-loop.ll +++ b/llvm/test/Transforms/LoopUnswitch/infinite-loop.ll @@ -16,7 +16,7 @@ ; CHECK-NEXT: br i1 %a, label %entry.split, label %abort0.split ; CHECK: entry.split: -; CHECK-NEXT: br i1 %b, label %entry.split.split, label %abort1.split +; CHECK-NEXT: br i1 %b, label %for.body, label %abort1.split ; CHECK: for.body: ; CHECK-NEXT: br label %for.body |