[BOLT] Fix profile for multi-entry functions
Summary: When we read profile for functions, we initialize counts for entry blocks first, and then populate counts for all blocks based on incoming edges. During the second phase we ignore the entry blocks because we expect them to be already initialized. For the primary entry at offset 0 it's the correct thing to do, since we treat all incoming branches as calls or tail calls. However, for secondary entries we only consider external edges to be from calls and don't increase entry count if an edge originates from inside the function. Thus we need to update the secondary entry basic block counts with internal edges too. (cherry picked from FBD6836817)
Loading
Please sign in to comment