diff --git a/src/mapleall/maple_me/src/lfo_iv_canon.cpp b/src/mapleall/maple_me/src/lfo_iv_canon.cpp index 6cdd31727abfe9f0f51c6f9dc30887be95ce65f6..fed13132b7193dff9472c8d1d2e8e051672149f0 100644 --- a/src/mapleall/maple_me/src/lfo_iv_canon.cpp +++ b/src/mapleall/maple_me/src/lfo_iv_canon.cpp @@ -40,6 +40,9 @@ bool IVCanon::ResolveExprValue(MeExpr *x, ScalarMeExpr *phiLHS) { return true; } ScalarMeExpr *scalar = static_cast(x); + if (!scalar->GetOst()->IsLocal() || scalar->GetOst()->IsAddressTaken()) { + return false; + } if (scalar->GetDefBy() != kDefByStmt) { return false; } diff --git a/src/mapleall/maple_me/src/me_ivopts.cpp b/src/mapleall/maple_me/src/me_ivopts.cpp index 84d3615592768a9d22d33a7d00d47a5d12f9c92e..3dab05df7e6a6128821b4af96aac5a0c705e55de 100644 --- a/src/mapleall/maple_me/src/me_ivopts.cpp +++ b/src/mapleall/maple_me/src/me_ivopts.cpp @@ -1432,7 +1432,7 @@ MeExpr *IVOptimizer::ComputeExtraExprOfBase(MeExpr &candBase, MeExpr &groupBase, for (auto &itCand : candMap) { auto itGroup = groupMap.find(itCand.first); if (itCand.first == kInvalidExprID) { - candConst = itCand.second.second * ratio; + candConst = (uint64)itCand.second.second * ratio; groupConst = itGroup == groupMap.end() ? 0 : itGroup->second.second; continue; }