Commit Graph

5 Commits

Author SHA1 Message Date
Daniel Rodríguez Troitiño
38ef675a5a [test] Add REQUIRES: assert to test using --debug-only (#76443)
The test is using LLVM's `--debug-only=` but it is not marked as
`REQUIRES: asserts`, so it will try to run in non-asserts compilers and
fail.`
2024-09-13 11:27:19 -07:00
Kavon Farvardin
2caaad0ba2 ColdBlockInfo: post-order walk converges faster
I thought `reverse(silFn)` would do a post-order walk, but I was wrong.

This patch cuts the number of iterations to propagate coldness from
3-4 down to 2 in a few of the simple regression test cases. At least on
macOS (as the stdlib can vary per platform).
2024-09-11 13:27:39 -07:00
Kavon Farvardin
c54e788b34 ColdBlockInfo: add another test case 2024-09-11 12:26:59 -07:00
Kavon Farvardin
3e93a21a21 ColdBlockInfo: stop early if no coldness
There's no reason to do further stages of analysis to propagate coldness
if there wasn't any found in Stage 1.
2024-09-11 11:54:10 -07:00
Kavon Farvardin
7203a4fa73 ColdBlockInfo: overhaul analysis pass
The old analysis pass doesn't take into account profile data, nor does
it consider post-dominance. It primarily dealt with _fastPath/_slowPath.

A block that is dominated by a cold block is itself cold. That's true
whether it's forwards or backwards dominance.

We can also consider a call to any `Never` returning function as a
cold-exit, though the block(s) leading up to that call may be executed
frequently because of concurrency. For now, I'm ignoring the concurrency
case and assuming it's cold. To make use of this "no return" prediction,
use the `-enable-noreturn-prediction` flag, which is currently off by
default.
2024-09-03 15:41:10 -07:00