- /// removeSuccessor - Remove specified successor from the successors list of
- /// this MachineBasicBlock. The Predecessors list of succ is automatically
- /// updated. Return the iterator to the element after the one removed.
- ///
+ /// Add Succ as a successor of this MachineBasicBlock. The Predecessors list
+ /// of Succ is automatically updated. The probability is not provided because
+ /// BPI is not available (e.g. -O0 is used), in which case edge probabilities
+ /// won't be used. Using this interface can save some space.
+ void addSuccessorWithoutProb(MachineBasicBlock *Succ);
+
+ /// Set successor weight of a given iterator.
+ void setSuccWeight(succ_iterator I, uint32_t Weight);
+
+ /// Set successor probability of a given iterator.
+ void setSuccProbability(succ_iterator I, BranchProbability Prob);
+
+ /// Normalize probabilities of all successors so that the sum of them becomes
+ /// one.
+ void normalizeSuccProbs() {
+ BranchProbability::normalizeProbabilities(Probs);
+ }
+
+ /// Remove successor from the successors list of this MachineBasicBlock. The
+ /// Predecessors list of Succ is automatically updated.
+ void removeSuccessor(MachineBasicBlock *Succ);
+
+ /// Remove specified successor from the successors list of this
+ /// MachineBasicBlock. The Predecessors list of Succ is automatically updated.
+ /// Return the iterator to the element after the one removed.