I think calling PGSO size opt is probably a bit misleading though. It’s more of an adaptive opt strategy, and it can improve performance too due to better locality. We have something similar internally for selecting opt level based on profile hotness too under AutoFDO.
Perhaps similar implementations can all be unified under a profile guided “adaptive optimization” framework to avoid duplication:
- A unified way of setting hot/cold cutoff percentile (e.g. through PSI that’s already used by all PGO/FDO).
- A unified way of selecting opt strategy for cold functions: default, none, size, minsize.
Thanks,
Wenlei