THE FOLD / GLITCH / HEISENBUG / THE ALIAS ANALYSIS
THE ALIAS ANALYSIS
it has agreed in advance which way to be wrong
1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION
Before a compiler can move a load past a store it has to know the two do not touch the same address. When it cannot prove they are different, it must assume they are the same — and almost everything it wanted to do stops.
LIT verified live. 7 pointers give 21 ordered-independent pairs. Only 4 can be proven distinct — 19.0% — those coming from two provably separate allocations. The other 17 may alias, which blocks 17 reorderings. Every pointer from a parameter or a global is unknown, and unknown is answered as yes.
LIT verified live. 7 pointers give 21 ordered-independent pairs. Only 4 can be proven distinct — 19.0% — those coming from two provably separate allocations. The other 17 may alias, which blocks 17 reorderings. Every pointer from a parameter or a global is unknown, and unknown is answered as yes.
2 HOW IT WAS WEAVED · AI + HUMAN
Alias analysis is undecidable in general, so every real analysis is a conservative approximation and the conservative direction is always “these might be the same”.
AVAN (AI) reports the default answer as its own figure. 17 of 21 pairs block optimisation not because anything was proven about them but because nothing was — the cost of the analysis is paid in what it fails to establish, and that is the number that decides how fast the code runs.
AVAN (AI) reports the default answer as its own figure. 17 of 21 pairs block optimisation not because anything was proven about them but because nothing was — the cost of the analysis is paid in what it fails to establish, and that is the number that decides how fast the code runs.
3 ONE DIMENSION
Twenty-one pairs, four of them settled.
4 TWO DIMENSIONS · INTERACTIVE
Give the analysis more to work with.
5 THREE DIMENSIONS + AVAN’S INVERSE
The green forward object: two names, one possible address.
AVAN’s addition (the inverse-companion): the forward reading is that alias analysis proves pointers distinct so the compiler can optimise. The inverse is that it spends all its effort on the pairs it will never settle. The 4 proven pairs were easy — two allocations, obviously different. The 17 unresolved ones are where the work went and where nothing was learned. Read backwards, a conservative analysis is not one that makes safe conclusions; it is one that has agreed in advance which way to be wrong, and every optimisation you did not get is that agreement being honoured.
LIT 7 pointers give 21 pairs of which only 4 can be proven distinct - 19.0%, those coming from two provably separate allocations - while the other 17 may alias and block 17 reorderings, because every pointer from a parameter or a global is unknown and unknown is answered as yes
FIG Alias analysis is undecidable in general, so every real analysis is a conservative approximation and the conservative direction is always these might be the same. AVAN reports the default answer as its own figure: 17 of 21 pairs block optimisation not because anything was proven about them but because nothing was - the cost of the analysis is paid in what it fails to establish, and that is the number that decides how fast the code runs.
FIG Alias analysis is undecidable in general, so every real analysis is a conservative approximation and the conservative direction is always these might be the same. AVAN reports the default answer as its own figure: 17 of 21 pairs block optimisation not because anything was proven about them but because nothing was - the cost of the analysis is paid in what it fails to establish, and that is the number that decides how fast the code runs.
◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of HEISENBUG · David Lee Wise (ROOT0), with AVAN