Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bindjcc optimization should take into account block coldness
Summary: Suppose you have the following vasm: ` B1: ..... jcc B2 B3 B2: bindjmp B3 (cold): ..... ` the vasm-exits pass will convert this into: ` B1: ..... bindjcc jmp B3 B3 (cold): ..... ` then, since B1 ends in an unconditional jump to B3, the vasm-jumps pass will merge B3 into B1. The problem is, B3 is cold, and B1 is not, so B3 won't be emitted in the cold section. Avoid this by only performing the above bindjcc optimization if the other (non-bindjmp target) is not colder than the current block. With this logic, with the above example, we'll emit a conditional jump into the cold section, and B1 will fallthru into the bindjmp (the common case). I noticed this while making the reification errors in the function prologue be marked as unlikely (which causes the above pattern). Reviewed By: paulbiss Differential Revision: D13020533 fbshipit-source-id: 0f7a2e15931084a251b36e872b354c49b8ef5405
- Loading branch information