[PATCH] D57067: [MBP] Don't move bottom block before header if it can't reduce taken branches

Guozhi Wei via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 22 14:40:48 PST 2019


Carrot created this revision.
Carrot added a reviewer: davidxl.
Herald added subscribers: llvm-commits, jsji, nhaehnle, jvesely, nemanjai.

If bottom of block BB has only one successor OldTop, in most cases it is profitable to move it before OldTop, except the following case:

  -->OldTop<-
  |    .    |
  |    .    |
  |    .    |
  ---Pred   |
       |    |
      BB-----

Move BB before OldTop can't reduce the number of taken branches, this patch detects this case and prevent the moving.


Repository:
  rL LLVM

https://reviews.llvm.org/D57067

Files:
  lib/CodeGen/MachineBlockPlacement.cpp
  test/CodeGen/AMDGPU/si-annotate-cf.ll
  test/CodeGen/PowerPC/licm-remat.ll
  test/CodeGen/X86/2009-02-26-MachineLICMBug.ll
  test/CodeGen/X86/avx-cmp.ll
  test/CodeGen/X86/avx512-i1test.ll
  test/CodeGen/X86/code_placement_no_header_change.ll
  test/DebugInfo/X86/PR37234.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57067.182983.patch
Type: text/x-patch
Size: 10060 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190122/c86ad11a/attachment.bin>


More information about the llvm-commits mailing list