While loop rotation updates the branch_weights correctly for the most part there were some branches missing runtime unroll. This adds code to the loop rotation transformation to ensure that the computed block execution counts for the loop bodies are the same before and after the transformation.
Invariants and heuristics are explained in the comment in the new updateBranchWeights() function.
Would you mind putting the changes to ProfDataUtils in a separate patch? I think these are good additions to the library, so I think it's better if they go in their own commit. Since it just renames an internal interface(practically speaking), it can probably be marked NFC/NFCI.