diff options
author | Guozhi Wei <carrot@google.com> | 2019-06-14 23:08:59 +0000 |
---|---|---|
committer | Guozhi Wei <carrot@google.com> | 2019-06-14 23:08:59 +0000 |
commit | d2210af3322d8494e0518d113efa25e13a67987c (patch) | |
tree | 5a1b5a17c1fc7b85e204456e271d7469d42b914e /llvm/test/CodeGen/X86/code_placement_no_header_change.ll | |
parent | db88fc56b967da83a5fc1cb995cc765331a3e6cb (diff) | |
download | bcm5719-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/X86/code_placement_no_header_change.ll')
-rw-r--r-- | llvm/test/CodeGen/X86/code_placement_no_header_change.ll | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/test/CodeGen/X86/code_placement_no_header_change.ll b/llvm/test/CodeGen/X86/code_placement_no_header_change.ll index 0275606568c..ab173b8de71 100644 --- a/llvm/test/CodeGen/X86/code_placement_no_header_change.ll +++ b/llvm/test/CodeGen/X86/code_placement_no_header_change.ll @@ -7,9 +7,9 @@ define i32 @bar(i32 %count) { ; Later backedge1 and backedge2 is rotated before loop header. ; CHECK-LABEL: bar ; CHECK: %.entry +; CHECK: %.header ; CHECK: %.backedge1 ; CHECK: %.backedge2 -; CHECK: %.header ; CHECK: %.exit .entry: %c = shl nsw i32 %count, 2 |