Document another TR optimizer bug found via random testing.
Fix comment.
Document surprising control flow.
Fix interaction between early exits, filters and the optimizer.

Closes PR14828.
Add event logging to caching-managed-compile and parallel compile.

This allows for understanding where time is spend during a compile.
Mention that the Von Mangoldt function is not multiplicative