From dc5be41b070768f34e558654c0abf01a39fcf9e5 Mon Sep 17 00:00:00 2001 From: Fred Chow Date: Tue, 30 Aug 2022 14:58:29 -0700 Subject: [PATCH 1/2] profdata parser should abort when it cannot find the profdata file Added me option --dumpcfgofphases to help in triaging frequency update issues At end of optimizeCFG phase, call UpdateEdgeFreqWithBBFreq() Use i32 instead of u1 for comparison notes created in irmap Update frequencies in jumpThreading phase --- src/mapleall/maple_me/include/me_cfg.h | 6 +++- src/mapleall/maple_me/include/me_option.h | 1 + src/mapleall/maple_me/include/me_options.h | 1 + src/mapleall/maple_me/src/bb.cpp | 6 +++- src/mapleall/maple_me/src/irmap.cpp | 14 ++++---- src/mapleall/maple_me/src/me_bb_layout.cpp | 13 ++++---- .../maple_me/src/me_critical_edge.cpp | 3 ++ src/mapleall/maple_me/src/me_irmap_build.cpp | 3 ++ .../maple_me/src/me_jump_threading.cpp | 18 ++++++++++- src/mapleall/maple_me/src/me_option.cpp | 2 ++ src/mapleall/maple_me/src/me_options.cpp | 4 +++ src/mapleall/maple_me/src/optimizeCFG.cpp | 7 ++-- .../mpl2mpl/include/mpl_profdata_parser.h | 2 +- .../mpl2mpl/src/mpl_profdata_parser.cpp | 32 +++++++------------ 14 files changed, 73 insertions(+), 39 deletions(-) diff --git a/src/mapleall/maple_me/include/me_cfg.h b/src/mapleall/maple_me/include/me_cfg.h index 8465e37e75..eee61dc7eb 100644 --- a/src/mapleall/maple_me/include/me_cfg.h +++ b/src/mapleall/maple_me/include/me_cfg.h @@ -45,7 +45,11 @@ class MeCFG : public AnalysisResult { endTryBB2TryBB(mecfgAlloc.Adapter()), sccTopologicalVec(mecfgAlloc.Adapter()), sccOfBB(mecfgAlloc.Adapter()), - backEdges(mecfgAlloc.Adapter()) {} + backEdges(mecfgAlloc.Adapter()) { + if (MeOption::dumpCfgOfPhases) { + dumpIRProfileFile = true; + } + } ~MeCFG() = default; diff --git a/src/mapleall/maple_me/include/me_option.h b/src/mapleall/maple_me/include/me_option.h index ae78247e38..4e43e1e05e 100644 --- a/src/mapleall/maple_me/include/me_option.h +++ b/src/mapleall/maple_me/include/me_option.h @@ -184,6 +184,7 @@ class MeOption { static uint8 rematLevel; static bool layoutWithPredict; static bool unifyRets; + static bool dumpCfgOfPhases; // safety check option begin static SafetyCheckMode npeCheckMode; static bool isNpeCheckAll; diff --git a/src/mapleall/maple_me/include/me_options.h b/src/mapleall/maple_me/include/me_options.h index 4b009116a7..da127b6d3d 100644 --- a/src/mapleall/maple_me/include/me_options.h +++ b/src/mapleall/maple_me/include/me_options.h @@ -134,6 +134,7 @@ extern maplecl::Option warning; extern maplecl::Option remat; extern maplecl::Option unifyrets; extern maplecl::Option lfo; +extern maplecl::Option dumpCfgOfPhases; } diff --git a/src/mapleall/maple_me/src/bb.cpp b/src/mapleall/maple_me/src/bb.cpp index 181e6ed831..b01f4f0738 100644 --- a/src/mapleall/maple_me/src/bb.cpp +++ b/src/mapleall/maple_me/src/bb.cpp @@ -485,7 +485,11 @@ void BB::UpdateEdgeFreqs(bool updateBBFreqOfSucc) { succFreqs += GetSuccFreq()[i]; } int diff = static_cast(abs(succFreqs - GetFrequency())); - if (len == 0 || diff <= 1) {return;} + if (len == 0 || + (len == 1 && diff == 0) || + (len > 1 && diff <= 1)) { + return; + } for (uint32 i = 0; i < len; ++i) { int64_t sfreq = GetSuccFreq()[static_cast(i)]; int64_t scalefreq = (succFreqs == 0 ? (frequency / len) : (sfreq * frequency / succFreqs)); diff --git a/src/mapleall/maple_me/src/irmap.cpp b/src/mapleall/maple_me/src/irmap.cpp index ef20a5385a..4d93ad365b 100644 --- a/src/mapleall/maple_me/src/irmap.cpp +++ b/src/mapleall/maple_me/src/irmap.cpp @@ -1942,7 +1942,7 @@ MeExpr *IRMap::SimplifyCmpExpr(OpMeExpr *cmpExpr) { return opnd0; } else if ((cmpop == OP_ne && opnd1const->IsOne()) || (cmpop == OP_eq && opnd1const->IsZero())) { if (IsCompareHasReverseOp(opnd0->GetOp())) { - OpMeExpr reverseMeExpr(kInvalidExprID, GetReverseCmpOp(opnd0->GetOp()), PTY_u1, opnd0->GetNumOpnds()); + OpMeExpr reverseMeExpr(kInvalidExprID, GetReverseCmpOp(opnd0->GetOp()), PTY_i32, opnd0->GetNumOpnds()); reverseMeExpr.SetOpnd(0, opnd0->GetOpnd(0)); reverseMeExpr.SetOpnd(1, opnd0->GetOpnd(1)); reverseMeExpr.SetOpndType(static_cast(opnd0)->GetOpndType()); @@ -1959,7 +1959,7 @@ MeExpr *IRMap::SimplifyCmpExpr(OpMeExpr *cmpExpr) { if (constVal->GetKind() == kConstInt && constVal->IsZero()) { auto *subOpnd0 = opnd0->GetOpnd(0); auto *subOpnd1 = opnd0->GetOpnd(1); - return CreateMeExprCompare(cmpop, PTY_u1, subOpnd0->GetPrimType(), *subOpnd0, *subOpnd1); + return CreateMeExprCompare(cmpop, PTY_i32, subOpnd0->GetPrimType(), *subOpnd0, *subOpnd1); } } break; @@ -1976,13 +1976,13 @@ MeExpr *IRMap::SimplifyCmpExpr(OpMeExpr *cmpExpr) { } // we prefer ne/eq in following optimizations if (opnd0->GetMeOp() == kMeOpConst && static_cast(opnd0)->GetConstVal()->IsZero()) { - auto *newcmp = CreateMeExprCompare(cmpop == OP_ge ? OP_eq : OP_ne, PTY_u1, cmpExpr->GetOpndType(), + auto *newcmp = CreateMeExprCompare(cmpop == OP_ge ? OP_eq : OP_ne, PTY_i32, cmpExpr->GetOpndType(), *opnd1, *CreateIntConstMeExpr(0, cmpExpr->GetOpndType())); auto *simplified = SimplifyCmpExpr(static_cast(newcmp)); return simplified == nullptr ? newcmp : simplified; } if (opnd1->GetMeOp() == kMeOpConst && static_cast(opnd1)->GetConstVal()->IsOne()) { - auto *newcmp = CreateMeExprCompare(cmpop == OP_ge ? OP_ne : OP_eq, PTY_u1, cmpExpr->GetOpndType(), + auto *newcmp = CreateMeExprCompare(cmpop == OP_ge ? OP_ne : OP_eq, PTY_i32, cmpExpr->GetOpndType(), *opnd0, *CreateIntConstMeExpr(0, cmpExpr->GetOpndType())); auto *simplified = SimplifyCmpExpr(static_cast(newcmp)); return simplified == nullptr ? newcmp : simplified; @@ -2002,13 +2002,13 @@ MeExpr *IRMap::SimplifyCmpExpr(OpMeExpr *cmpExpr) { } // we prefer ne/eq in following optimizations if (opnd1->GetMeOp() == kMeOpConst && static_cast(opnd1)->GetConstVal()->IsZero()) { - auto *newcmp = CreateMeExprCompare(cmpop == OP_gt ? OP_ne : OP_eq, PTY_u1, cmpExpr->GetOpndType(), + auto *newcmp = CreateMeExprCompare(cmpop == OP_gt ? OP_ne : OP_eq, PTY_i32, cmpExpr->GetOpndType(), *opnd0, *CreateIntConstMeExpr(0, cmpExpr->GetOpndType())); auto *simplified = SimplifyCmpExpr(static_cast(newcmp)); return simplified == nullptr ? newcmp : simplified; } if (opnd0->GetMeOp() == kMeOpConst && static_cast(opnd0)->GetConstVal()->IsOne()) { - auto *newcmp = CreateMeExprCompare(cmpop == OP_gt ? OP_eq : OP_ne, PTY_u1, cmpExpr->GetOpndType(), + auto *newcmp = CreateMeExprCompare(cmpop == OP_gt ? OP_eq : OP_ne, PTY_i32, cmpExpr->GetOpndType(), *opnd1, *CreateIntConstMeExpr(0, cmpExpr->GetOpndType())); auto *simplified = SimplifyCmpExpr(static_cast(newcmp)); return simplified == nullptr ? newcmp : simplified; @@ -2599,7 +2599,7 @@ MeExpr *IRMap::SimplifyOpMeExpr(OpMeExpr *opmeexpr) { case OP_lnot: { MeExpr *opnd0 = opmeexpr->GetOpnd(0); if (IsCompareHasReverseOp(opnd0->GetOp())) { - OpMeExpr reverseMeExpr(kInvalidExprID, GetReverseCmpOp(opnd0->GetOp()), PTY_u1, opnd0->GetNumOpnds()); + OpMeExpr reverseMeExpr(kInvalidExprID, GetReverseCmpOp(opnd0->GetOp()), PTY_i32, opnd0->GetNumOpnds()); reverseMeExpr.SetOpnd(0, opnd0->GetOpnd(0)); reverseMeExpr.SetOpnd(1, opnd0->GetOpnd(1)); reverseMeExpr.SetOpndType(opnd0->GetOpnd(0)->GetPrimType()); diff --git a/src/mapleall/maple_me/src/me_bb_layout.cpp b/src/mapleall/maple_me/src/me_bb_layout.cpp index 8c5612db86..ceafc3e6b0 100644 --- a/src/mapleall/maple_me/src/me_bb_layout.cpp +++ b/src/mapleall/maple_me/src/me_bb_layout.cpp @@ -1377,16 +1377,17 @@ bool MEBBLayout::PhaseRun(maple::MeFunction &f) { bbLayout->RunLayout(); f.SetLaidOutBBs(bbLayout->GetBBs()); - if (DEBUGFUNC_NEWPM(f) || Options::profileUse) { - // verify CFG : check condBB's succs should be different - bbLayout->VerifyBB(); - bbLayout->DumpBBPhyOrder(); + if (Options::profileUse) { if (cfg->UpdateCFGFreq() && cfg->DumpIRProfileFile()) { cfg->DumpToFile("after-bblayout", false, true); - } else { - cfg->DumpToFile("afterBBLayout", false); } } + if (DEBUGFUNC_NEWPM(f)) { + // verify CFG : check condBB's succs should be different + bbLayout->VerifyBB(); + bbLayout->DumpBBPhyOrder(); + cfg->DumpToFile("afterBBLayout", false); + } return true; } } // namespace maple diff --git a/src/mapleall/maple_me/src/me_critical_edge.cpp b/src/mapleall/maple_me/src/me_critical_edge.cpp index 4dca8f82a2..fd97bb2452 100644 --- a/src/mapleall/maple_me/src/me_critical_edge.cpp +++ b/src/mapleall/maple_me/src/me_critical_edge.cpp @@ -313,6 +313,9 @@ bool MESplitCEdge::PhaseRun(maple::MeFunction &f) { f.GetPreMeFunc()->pmeCreatedWhileLabelSet.clear(); } } + if (f.GetCfg()->UpdateCFGFreq() && (f.GetCfg()->DumpIRProfileFile())) { + f.GetCfg()->DumpToFile("after-splitcriticaledge", false, true); + } return false; } } // namespace maple diff --git a/src/mapleall/maple_me/src/me_irmap_build.cpp b/src/mapleall/maple_me/src/me_irmap_build.cpp index f34555f5c6..76449544f7 100644 --- a/src/mapleall/maple_me/src/me_irmap_build.cpp +++ b/src/mapleall/maple_me/src/me_irmap_build.cpp @@ -58,6 +58,9 @@ bool MEIRMapBuild::PhaseRun(maple::MeFunction &f) { } if (DEBUGFUNC_NEWPM(f)) { irMap->Dump(); + if (f.GetCfg()->UpdateCFGFreq()) { + f.GetCfg()->DumpToFile("irmapbuild", true, true); + } } // delete mempool for meirmap temporaries diff --git a/src/mapleall/maple_me/src/me_jump_threading.cpp b/src/mapleall/maple_me/src/me_jump_threading.cpp index 9d8580ae67..fd7430f66a 100644 --- a/src/mapleall/maple_me/src/me_jump_threading.cpp +++ b/src/mapleall/maple_me/src/me_jump_threading.cpp @@ -163,6 +163,11 @@ void JumpThreading::ConnectNewPath(std::vector &currPath, std::vectorAddSucc(*newSuccBB); + if (func.GetCfg()->UpdateCFGFreq()) { + uint64 freqUsed = old2NewBB[idxOfCurrBB].second->GetFrequency(); + old2NewBB[idxOfCurrBB].second->PushBackSuccFreq(freqUsed); + newSuccBB->SetFrequency(freqUsed); + } break; } for (auto *temp : currentBB->GetSucc()) { @@ -182,8 +187,16 @@ void JumpThreading::ConnectNewPath(std::vector &currPath, std::vectorReplaceSucc(temp, newTemp, true); + if (func.GetCfg()->UpdateCFGFreq()) { + int idxInSucc = currentBB->GetSuccIndex(*newTemp); + newTemp->SetFrequency(currentBB->GetSuccFreq()[idxInSucc]); + } } else { old2NewBB[idxOfCurrBB].second->AddSucc(*newTemp); + if (func.GetCfg()->UpdateCFGFreq()) { + old2NewBB[idxOfCurrBB].second->PushBackSuccFreq(0); + newTemp->SetFrequency(0); + } } } else if (currentBB != old2NewBB[idxOfCurrBB].second) { // Deal with the case like the succ of currentBB is not in path. @@ -192,6 +205,9 @@ void JumpThreading::ConnectNewPath(std::vector &currPath, std::vectorAddSucc(*newTemp); + if (func.GetCfg()->UpdateCFGFreq()) { + old2NewBB[idxOfCurrBB].second->PushBackSuccFreq(newTemp->GetFrequency()); + } } // Set label for new bb. SetNewOffsetOfLastMeStmtForNewBB(*currentBB, *old2NewBB[idxOfCurrBB].second, *temp, *newTemp); @@ -770,4 +786,4 @@ bool MEJumpThreading::PhaseRun(maple::MeFunction &f) { } return false; } -} // namespace maple \ No newline at end of file +} // namespace maple diff --git a/src/mapleall/maple_me/src/me_option.cpp b/src/mapleall/maple_me/src/me_option.cpp index f07a369ab0..d062458a0d 100644 --- a/src/mapleall/maple_me/src/me_option.cpp +++ b/src/mapleall/maple_me/src/me_option.cpp @@ -131,6 +131,7 @@ bool MeOption::isNpeCheckAll = false; SafetyCheckMode MeOption::boundaryCheckMode = SafetyCheckMode::kNoCheck; bool MeOption::safeRegionMode = false; bool MeOption::unifyRets = false; +bool MeOption::dumpCfgOfPhases = false; #if MIR_JAVA std::string MeOption::acquireFuncName = "Landroid/location/LocationManager;|requestLocationUpdates|"; std::string MeOption::releaseFuncName = "Landroid/location/LocationManager;|removeUpdates|"; @@ -313,6 +314,7 @@ bool MeOption::SolveOptions(bool isDebug) { maplecl::CopyIfEnabled(dseKeepRef, opts::me::dsekeepref); maplecl::CopyIfEnabled(lessThrowAlias, opts::me::lessthrowalias); maplecl::CopyIfEnabled(propBase, opts::me::propbase); + maplecl::CopyIfEnabled(dumpCfgOfPhases, opts::me::dumpCfgOfPhases); if (opts::me::propiloadref.IsEnabledByUser()) { propIloadRef = opts::me::propiloadref; diff --git a/src/mapleall/maple_me/src/me_options.cpp b/src/mapleall/maple_me/src/me_options.cpp index 66103cf29f..79adab5f52 100644 --- a/src/mapleall/maple_me/src/me_options.cpp +++ b/src/mapleall/maple_me/src/me_options.cpp @@ -695,4 +695,8 @@ maplecl::Option lfo({"--lfo"}, {meCategory}, maplecl::DisableWith("--no-lfo")); +maplecl::Option dumpCfgOfPhases({"--dumpcfgofphases"}, + " --dumpcfgofphases \tDump CFG from various phases to .dot files\n", + {meCategory}); + } diff --git a/src/mapleall/maple_me/src/optimizeCFG.cpp b/src/mapleall/maple_me/src/optimizeCFG.cpp index 776d206d46..4dbe27cf57 100644 --- a/src/mapleall/maple_me/src/optimizeCFG.cpp +++ b/src/mapleall/maple_me/src/optimizeCFG.cpp @@ -2670,8 +2670,11 @@ bool MEOptimizeCFG::PhaseRun(maple::MeFunction &f) { MeSSAUpdate ssaUpdate(f, *f.GetMeSSATab(), *dom, cands); ssaUpdate.Run(); } - if (f.GetCfg()->DumpIRProfileFile()) { - f.GetCfg()->DumpToFile("after-OptimizeCFG", false, f.GetCfg()->UpdateCFGFreq()); + if (f.GetCfg()->UpdateCFGFreq()) { + f.GetCfg()->UpdateEdgeFreqWithBBFreq(); + if (f.GetCfg()->DumpIRProfileFile()) { + f.GetCfg()->DumpToFile("after-OptimizeCFG", false, f.GetCfg()->UpdateCFGFreq()); + } } } return change; diff --git a/src/mapleall/mpl2mpl/include/mpl_profdata_parser.h b/src/mapleall/mpl2mpl/include/mpl_profdata_parser.h index 1a83fa5c83..386895da8a 100644 --- a/src/mapleall/mpl2mpl/include/mpl_profdata_parser.h +++ b/src/mapleall/mpl2mpl/include/mpl_profdata_parser.h @@ -81,7 +81,7 @@ class ProfDataBinaryImportBase { class ProfileSummaryImport : public ProfDataBinaryImportBase { public: ProfileSummaryImport(std::string &outputFile, std::ifstream &input) : ProfDataBinaryImportBase(outputFile, input) {} - int ReadSummary(MplProfileData*); + void ReadSummary(MplProfileData*); private: void ReadMProfMagic(); diff --git a/src/mapleall/mpl2mpl/src/mpl_profdata_parser.cpp b/src/mapleall/mpl2mpl/src/mpl_profdata_parser.cpp index eeaa70cd47..d8b5deefa1 100644 --- a/src/mapleall/mpl2mpl/src/mpl_profdata_parser.cpp +++ b/src/mapleall/mpl2mpl/src/mpl_profdata_parser.cpp @@ -40,12 +40,12 @@ T ProfDataBinaryImportBase::ReadNum() { return static_cast(val); } -int ProfileSummaryImport::ReadSummary(MplProfileData *profData) { +void ProfileSummaryImport::ReadSummary(MplProfileData *profData) { CHECK_FATAL(profData != nullptr, "sanity check"); uint64_t magicNum = ReadNum(); if (magicNum != kMapleProfDataMagicNumber) { LogInfo::MapleLogger() << "magic number error, quit\n"; - return 1; + abort(); } uint64_t checksum = ReadNum(); uint32_t runtimes = ReadNum(); @@ -62,8 +62,6 @@ int ProfileSummaryImport::ReadSummary(MplProfileData *profData) { uint64_t r4 = ReadNum(); profData->summary.AddHistogramRecord(r1, r2, r3, r4); } - - return 0; } int FunctionProfileImport::ReadFuncProfile(MplProfileData *profData) { @@ -97,19 +95,19 @@ int MplProfDataParser::ReadMapleProfileData() { static_cast(mprofDataFile.append("/")); } if (dumpDetail) { - LogInfo::MapleLogger() << "set env gcov_prefix= " << mprofDataFile << std::endl; + LogInfo::MapleLogger() << "set env GCOV_PREFIX= " << mprofDataFile << std::endl; } uint32_t stripnum = 0; if (const char *envGcovprefixstrip = std::getenv("GCOV_PREFIX_STRIP")) { std::string strip(envGcovprefixstrip); stripnum = static_cast(std::stoi(strip)); if (dumpDetail) { - LogInfo::MapleLogger() << "set env gcov_prefix_strip=" << strip << std::endl; + LogInfo::MapleLogger() << "set env GCOV_PREFIX_STRIP=" << strip << std::endl; } } std::string profDataFileName = m.GetProfileDataFileName(); if (dumpDetail) { - LogInfo::MapleLogger() << "module profdata Name: " << profDataFileName << std::endl; + LogInfo::MapleLogger() << "profdata file stem before strip: " << profDataFileName << std::endl; } // reduce path in profDataFileName while (stripnum > 0 && profDataFileName.size() > 1) { @@ -121,7 +119,7 @@ int MplProfDataParser::ReadMapleProfileData() { stripnum--; } if (dumpDetail) { - LogInfo::MapleLogger() << "after strip, module profdata Name: " << profDataFileName << std::endl; + LogInfo::MapleLogger() << "profdata file stem after strip: " << profDataFileName << std::endl; } CHECK_FATAL(profDataFileName.size() > 0, "sanity check"); static_cast(mprofDataFile.append(profDataFileName)); @@ -129,23 +127,21 @@ int MplProfDataParser::ReadMapleProfileData() { // if gcov_prefix is not set, find .mprofdata according to m.profiledata mprofDataFile = m.GetProfileDataFileName(); if (dumpDetail) { - LogInfo::MapleLogger() << "NO ENV, module profdata Name: " << mprofDataFile << std::endl; + LogInfo::MapleLogger() << "NO ENV, profdata file stem: " << mprofDataFile << std::endl; } } // add .mprofdata static_cast(mprofDataFile.append(namemangler::kMplProfFileNameExt)); } ASSERT(!mprofDataFile.empty(), "null check"); - if (dumpDetail) { - LogInfo::MapleLogger() << "will open mprofileData " << mprofDataFile << std::endl; - } + LogInfo::MapleLogger() << "profileUse will open " << mprofDataFile << std::endl; // create mpl profdata profData = mempool->New(mempool, &alloc); // read .mprofdata std::ifstream inputStream(mprofDataFile, (std::ios::in | std::ios::binary)); if (!inputStream) { LogInfo::MapleLogger() << "Could not open the file " << mprofDataFile << "\n"; - return 1; + abort(); } // get length of file static_cast(inputStream.seekg(0, std::ios::end)); @@ -160,18 +156,14 @@ int MplProfDataParser::ReadMapleProfileData() { // read 1st part summary ProfileSummaryImport summaryImport(mprofDataFile, inputStream); summaryImport.SetPosition(static_cast(static_cast(buffer.get()))); - int res = summaryImport.ReadSummary(profData); - if (res) { - LogInfo::MapleLogger() << "no summary part\n"; - return 1; - } + summaryImport.ReadSummary(profData); if (dumpDetail) { profData->summary.DumpSummary(); } // read 2nd part function profile data FunctionProfileImport funcImport(mprofDataFile, inputStream); funcImport.SetPosition(summaryImport.GetPosition()); - res = funcImport.ReadFuncProfile(profData); + int res = funcImport.ReadFuncProfile(profData); if (res) { LogInfo::MapleLogger() << "no function profile part\n"; return 1; @@ -188,7 +180,7 @@ void MMplProfDataParser::GetAnalysisDependence(AnalysisDep &aDep) const { bool MMplProfDataParser::PhaseRun(maple::MIRModule &m) { MemPool *memPool = m.GetMemPool(); // use global pool to store profile data - bool enableDebug = true; // true to dump trace + bool enableDebug = false; // true to dump trace MplProfDataParser parser(m, memPool, enableDebug); int res = parser.ReadMapleProfileData(); if (res) { -- Gitee From e0ec4a5e80e930428dffb562414dba2b791a2b06 Mon Sep 17 00:00:00 2001 From: Fred Chow Date: Wed, 31 Aug 2022 20:03:12 -0700 Subject: [PATCH 2/2] Added missing type casts --- src/mapleall/maple_me/src/me_jump_threading.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mapleall/maple_me/src/me_jump_threading.cpp b/src/mapleall/maple_me/src/me_jump_threading.cpp index fd7430f66a..9f6cee9096 100644 --- a/src/mapleall/maple_me/src/me_jump_threading.cpp +++ b/src/mapleall/maple_me/src/me_jump_threading.cpp @@ -166,7 +166,7 @@ void JumpThreading::ConnectNewPath(std::vector &currPath, std::vectorUpdateCFGFreq()) { uint64 freqUsed = old2NewBB[idxOfCurrBB].second->GetFrequency(); old2NewBB[idxOfCurrBB].second->PushBackSuccFreq(freqUsed); - newSuccBB->SetFrequency(freqUsed); + newSuccBB->SetFrequency(static_cast(freqUsed)); } break; } @@ -189,7 +189,7 @@ void JumpThreading::ConnectNewPath(std::vector &currPath, std::vectorReplaceSucc(temp, newTemp, true); if (func.GetCfg()->UpdateCFGFreq()) { int idxInSucc = currentBB->GetSuccIndex(*newTemp); - newTemp->SetFrequency(currentBB->GetSuccFreq()[idxInSucc]); + newTemp->SetFrequency(static_cast(currentBB->GetSuccFreq()[idxInSucc])); } } else { old2NewBB[idxOfCurrBB].second->AddSucc(*newTemp); -- Gitee