Don't set the function hotness attribute on the fly. This changes the CFG branch probability of the caller function, which leads to inconsistent BB ordering. This patch moves the attribute setting to a separated loop after the counts in all functions are populated.
Fixes PR27024 - PGO instrumentation profile data is not reflected in correct basic blocks.
Initialize FreqAttr to Normal