Include static prof data when collecting loop BBs
authorBill Wendling <isanbard@gmail.com>
Wed, 19 Feb 2020 01:13:21 +0000 (17:13 -0800)
committerBill Wendling <isanbard@gmail.com>
Wed, 19 Feb 2020 19:33:48 +0000 (11:33 -0800)
commit129c911efaa492790c251b3eb18e4db36b55cbc5
tree7b998cec77842aaaef540d9080dcea769d68749c
parent076475713c236081a3247a53e9dbab9043c3eac2
Include static prof data when collecting loop BBs

Summary:
If the programmer adds static profile data to a branch---i.e. uses
"__builtin_expect()" or similar---then we should honor it. Otherwise,
"__builtin_expect()" is ignored in crucial situations. So we trust that
the programmer knows what they're doing until proven wrong.

Subscribers: hiraditya, JDevlieghere, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D74809
llvm/include/llvm/CodeGen/MachineLoopInfo.h
llvm/lib/CodeGen/MachineBlockPlacement.cpp
llvm/lib/CodeGen/MachineLoopInfo.cpp
llvm/test/CodeGen/Hexagon/prof-early-if.ll
llvm/test/CodeGen/X86/block-placement-2.ll [new file with mode: 0644]
llvm/test/CodeGen/X86/block-placement.ll
llvm/test/CodeGen/X86/move_latch_to_loop_top.ll
llvm/test/CodeGen/X86/ragreedy-bug.ll