OSDN Git Service

PGO branch weight: update edge weights in IfConverter.
authorManman Ren <manman.ren@gmail.com>
Wed, 29 Jan 2014 23:18:47 +0000 (23:18 +0000)
committerManman Ren <manman.ren@gmail.com>
Wed, 29 Jan 2014 23:18:47 +0000 (23:18 +0000)
commitea120b6bb52cd796d3879353aeec214599bd9b96
tree29f1635a128d1d316e168c692c40d4cc3660b38f
parent65a12969f9c8610e304efc096f94c955fc94abf2
PGO branch weight: update edge weights in IfConverter.

This commit only handles IfConvertTriangle. To update edge weights
of a successor, one interface is added to MachineBasicBlock:
/// Set successor weight of a given iterator.
setSuccWeight(succ_iterator I, uint32_t weight)

An existing testing case test/CodeGen/Thumb2/v8_IT_5.ll is updated,
since we now correctly update the edge weights, the cold block
is placed at the end of the function and we jump to the cold block.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200428 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/MachineBasicBlock.h
lib/CodeGen/IfConversion.cpp
lib/CodeGen/MachineBasicBlock.cpp
test/CodeGen/ARM/ifcvt-branch-weight.ll [new file with mode: 0644]
test/CodeGen/Thumb2/v8_IT_5.ll