summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/ARM/code-placement.ll
diff options
context:
space:
mode:
authorGuozhi Wei <carrot@google.com>2019-06-14 23:08:59 +0000
committerGuozhi Wei <carrot@google.com>2019-06-14 23:08:59 +0000
commitd2210af3322d8494e0518d113efa25e13a67987c (patch)
tree5a1b5a17c1fc7b85e204456e271d7469d42b914e /llvm/test/CodeGen/ARM/code-placement.ll
parentdb88fc56b967da83a5fc1cb995cc765331a3e6cb (diff)
downloadbcm5719-llvm-d2210af3322d8494e0518d113efa25e13a67987c.tar.gz
bcm5719-llvm-d2210af3322d8494e0518d113efa25e13a67987c.zip
[MBP] Move a latch block with conditional exit and multi predecessors to top of loop
Current findBestLoopTop can find and move one kind of block to top, a latch block has one successor. Another common case is: * a latch block * it has two successors, one is loop header, another is exit * it has more than one predecessors If it is below one of its predecessors P, only P can fall through to it, all other predecessors need a jump to it, and another conditional jump to loop header. If it is moved before loop header, all its predecessors jump to it, then fall through to loop header. So all its predecessors except P can reduce one taken branch. Differential Revision: https://reviews.llvm.org/D43256 llvm-svn: 363471
Diffstat (limited to 'llvm/test/CodeGen/ARM/code-placement.ll')
-rw-r--r--llvm/test/CodeGen/ARM/code-placement.ll4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/test/CodeGen/ARM/code-placement.ll b/llvm/test/CodeGen/ARM/code-placement.ll
index b381aecc69a..ed58090c4b9 100644
--- a/llvm/test/CodeGen/ARM/code-placement.ll
+++ b/llvm/test/CodeGen/ARM/code-placement.ll
@@ -38,8 +38,9 @@ entry:
br i1 %0, label %bb5, label %bb.nph15
bb1: ; preds = %bb2.preheader, %bb1
+; CHECK: LBB1_[[BB3:.]]: @ %bb3
; CHECK: LBB1_[[PREHDR:.]]: @ %bb2.preheader
-; CHECK: blt LBB1_[[BB3:.]]
+; CHECK: blt LBB1_[[BB3]]
%indvar = phi i32 [ %indvar.next, %bb1 ], [ 0, %bb2.preheader ] ; <i32> [#uses=2]
%sum.08 = phi i32 [ %2, %bb1 ], [ %sum.110, %bb2.preheader ] ; <i32> [#uses=1]
%tmp17 = sub i32 %i.07, %indvar ; <i32> [#uses=1]
@@ -53,7 +54,6 @@ bb1: ; preds = %bb2.preheader, %bb1
bb3: ; preds = %bb1, %bb2.preheader
; CHECK: LBB1_[[BB1:.]]: @ %bb1
; CHECK: bne LBB1_[[BB1]]
-; CHECK: LBB1_[[BB3]]: @ %bb3
%sum.0.lcssa = phi i32 [ %sum.110, %bb2.preheader ], [ %2, %bb1 ] ; <i32> [#uses=2]
%3 = add i32 %pass.011, 1 ; <i32> [#uses=2]
%exitcond18 = icmp eq i32 %3, %passes ; <i1> [#uses=1]
OpenPOWER on IntegriCloud