Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BOLT] Fix SCTC execution count assertion
Summary: SCTC is currently asserting (my fault :-) when running in combination with hot jump table entries optimization. This optimization sets the frequency for edges connecting basic blocks it creates and jump table targets based on the execution count of the original BB containing the indirect jump. This is OK as an estimation, but it breaks our assumption that the sum of the frequency of preds edges equals to our BB frequency. This happens because the frequency of the BB is rarely equal to its outgoing edges frequency. SCTC, in turn, was updating the execution count for BBs with tail calls by subtracting the frequency count of predecessor edges. Because hot jump table entries optimization broke the BB exec count = sum(preds freq) invariant, SCTC was asserting. To trigger this, the input program must have a jump table where each entry contains a tail call. This happens in the HHVM binary for func _ZN4HPHP11collections5issetEPNS_10ObjectDataEPKNS_10TypedValueE. (cherry picked from FBD5222504)
- Loading branch information