diff --git a/src/mapleall/maple_be/src/cg/cg_cfg.cpp b/src/mapleall/maple_be/src/cg/cg_cfg.cpp index d29ea8c596927bc728469633156b39ab02acf4bd..a2d73f622029d4a4354fced049779068218628ac 100644 --- a/src/mapleall/maple_be/src/cg/cg_cfg.cpp +++ b/src/mapleall/maple_be/src/cg/cg_cfg.cpp @@ -885,6 +885,13 @@ void CGCFG::UpdatePredsSuccsAfterSplit(BB &pred, BB &succ, BB &newBB) const { } } } + if (cgFunc->GetFunction().GetFuncProfData() != nullptr) { + newBB.InitEdgeProfFreq(); + FreqType newBBFreq = pred.GetEdgeProfFreq(succ); + newBB.SetProfFreq(newBBFreq); + pred.SetEdgeProfFreq(&newBB, newBBFreq); + newBB.SetEdgeProfFreq(&succ, newBBFreq); + } } #if TARGAARCH64 diff --git a/src/mapleall/maple_me/src/me_cfg.cpp b/src/mapleall/maple_me/src/me_cfg.cpp index c532c305c52485290d51f765323079b0aa79043d..5b9c1a56cd09deed69b587ed6cf84e8e1777e415 100644 --- a/src/mapleall/maple_me/src/me_cfg.cpp +++ b/src/mapleall/maple_me/src/me_cfg.cpp @@ -1941,14 +1941,14 @@ void MeCFG::ConstructBBFreqFromStmtFreq() { if ((*bIt)->IsEmpty()) continue; StmtNode &first = (*bIt)->GetFirst(); StmtNode &last = (*bIt)->GetLast(); - if (funcData->stmtFreqs.count(first.GetStmtID()) >= 0) { + if (funcData->stmtFreqs.count(first.GetStmtID()) > 0) { (*bIt)->SetFrequency(funcData->stmtFreqs[first.GetStmtID()]); - } else if (funcData->stmtFreqs.count(last.GetStmtID()) >= 0) { + } else if (funcData->stmtFreqs.count(last.GetStmtID()) > 0) { (*bIt)->SetFrequency(funcData->stmtFreqs[last.GetStmtID()]); } else { bool foundFreq = false; for (StmtNode &stmt : (*bIt)->GetStmtNodes()) { - if (funcData->stmtFreqs.count(stmt.GetStmtID()) >= 0) { + if (funcData->stmtFreqs.count(stmt.GetStmtID()) > 0) { (*bIt)->SetFrequency(funcData->stmtFreqs[stmt.GetStmtID()]); foundFreq = true; break;