mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
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
This commit is contained in:
@ -1123,6 +1123,13 @@ uint32_t MachineBasicBlock::getSuccWeight(const_succ_iterator Succ) const {
|
||||
return *getWeightIterator(Succ);
|
||||
}
|
||||
|
||||
/// Set successor weight of a given iterator.
|
||||
void MachineBasicBlock::setSuccWeight(succ_iterator I, uint32_t weight) {
|
||||
if (Weights.empty())
|
||||
return;
|
||||
*getWeightIterator(I) = weight;
|
||||
}
|
||||
|
||||
/// getWeightIterator - Return wight iterator corresonding to the I successor
|
||||
/// iterator
|
||||
MachineBasicBlock::weight_iterator MachineBasicBlock::
|
||||
|
Reference in New Issue
Block a user