diff --git a/src/mapleall/bin/debug/dex2mpl.tar.gz b/src/mapleall/bin/debug/dex2mpl.tar.gz index ab317304748087503343ecf918a18e0a0b9e7993..bbd47238fa0bb8eead38f6e4b007153de63de347 100644 Binary files a/src/mapleall/bin/debug/dex2mpl.tar.gz and b/src/mapleall/bin/debug/dex2mpl.tar.gz differ diff --git a/src/mapleall/maple_be/src/be/lower.cpp b/src/mapleall/maple_be/src/be/lower.cpp index 9a6cd209910e1efc2889027753924c986d87716f..1a808dd71c516d023283ace67e2093da01cf1905 100644 --- a/src/mapleall/maple_be/src/be/lower.cpp +++ b/src/mapleall/maple_be/src/be/lower.cpp @@ -394,7 +394,7 @@ BaseNode *CGLowerer::LowerCArray(ArrayNode &array) { int dim = arrayType->GetDim(); MIRType *innerType = nullptr; MIRArrayType *innerArrayType = nullptr; - uint32 elemSize = 0; + uint64 elemSize = 0; if (dim == 1) { innerType = GlobalTables::GetTypeTable().GetTypeFromTyIdx(arrayType->GetElemTyIdx()); if (innerType->GetKind() == kTypeArray) { @@ -409,7 +409,7 @@ BaseNode *CGLowerer::LowerCArray(ArrayNode &array) { } } - int32 numIndex = array.NumOpnds() - 1; + int32 numIndex = static_cast(array.NumOpnds()) - 1; MIRArrayType *curArrayType = arrayType; BaseNode *resNode = NodeConvert(array.GetPrimType(), *array.GetIndex(0)); if (dim > 1) { @@ -426,22 +426,22 @@ BaseNode *CGLowerer::LowerCArray(ArrayNode &array) { innerType = GlobalTables::GetTypeTable().GetTypeFromTyIdx(innerArrayType->GetElemTyIdx()); } } else { - CHECK_FATAL(arrayType->GetSizeArrayItem(i) > 0, "Zero size array dimension"); + CHECK_FATAL(arrayType->GetSizeArrayItem(static_cast(i)) > 0, "Zero size array dimension"); for (int j = i + 1; j < dim; j++) { - mpyDim *= arrayType->GetSizeArrayItem(j); + mpyDim *= arrayType->GetSizeArrayItem(static_cast(j)); } } - BaseNode *index = static_cast(array.GetIndex(i)); + BaseNode *index = static_cast(array.GetIndex(static_cast(i))); bool isConst = false; - int32 indexVal = 0; + int64 indexVal = 0; if (index->op == OP_constval) { ConstvalNode *constNode = static_cast(index); indexVal = (static_cast(constNode->GetConstVal()))->GetValue(); isConst = true; MIRIntConst *newConstNode = mirModule.GetMemPool()->New( - indexVal * mpyDim, - *GlobalTables::GetTypeTable().GetTypeFromTyIdx(TyIdx(array.GetPrimType()))); + indexVal * static_cast(mpyDim), + *GlobalTables::GetTypeTable().GetTypeFromTyIdx(TyIdx(array.GetPrimType()))); BaseNode *newValNode = mirModule.CurFuncCodeMemPool()->New(newConstNode); newValNode->SetPrimType(array.GetPrimType()); if (i == 0) { @@ -452,14 +452,14 @@ BaseNode *CGLowerer::LowerCArray(ArrayNode &array) { } } if (i > 0 && isConst == false) { - resNode = NodeConvert(array.GetPrimType(), *array.GetIndex(i)); + resNode = NodeConvert(array.GetPrimType(), *array.GetIndex(static_cast(i))); } BaseNode *mpyNode; if (isConst) { MIRIntConst *mulConst = mirModule.GetMemPool()->New( - mpyDim * indexVal, - *GlobalTables::GetTypeTable().GetTypeFromTyIdx(TyIdx(array.GetPrimType()))); + static_cast(mpyDim) * indexVal, + *GlobalTables::GetTypeTable().GetTypeFromTyIdx(TyIdx(array.GetPrimType()))); BaseNode *mulSize = mirModule.CurFuncCodeMemPool()->New(mulConst); mulSize->SetPrimType(array.GetPrimType()); mpyNode = mulSize; @@ -470,8 +470,7 @@ BaseNode *CGLowerer::LowerCArray(ArrayNode &array) { mpyNode = mirModule.CurFuncCodeMemPool()->New(OP_mul); mpyNode->SetPrimType(array.GetPrimType()); MIRIntConst *mulConst = mirModule.GetMemPool()->New( - mpyDim, - *GlobalTables::GetTypeTable().GetTypeFromTyIdx(TyIdx(array.GetPrimType()))); + mpyDim, *GlobalTables::GetTypeTable().GetTypeFromTyIdx(TyIdx(array.GetPrimType()))); BaseNode *mulSize = mirModule.CurFuncCodeMemPool()->New(mulConst); mulSize->SetPrimType(array.GetPrimType()); mpyNode->SetOpnd(NodeConvert(array.GetPrimType(), *mulSize), 0); @@ -492,7 +491,7 @@ BaseNode *CGLowerer::LowerCArray(ArrayNode &array) { BaseNode *rMul = nullptr; // esize is the size of the array element (eg. int = 4 long = 8) - uint32 esize; + uint64 esize; if (nestedArray) { esize = elemSize; } else { @@ -504,17 +503,15 @@ BaseNode *CGLowerer::LowerCArray(ArrayNode &array) { ConstvalNode *idxNode = static_cast(resNode); int64 idx = static_cast(idxNode->GetConstVal())->GetValue(); MIRIntConst *econst = mirModule.GetMemPool()->New( - idx * esize, - *GlobalTables::GetTypeTable().GetTypeFromTyIdx(TyIdx(array.GetPrimType()))); + idx * static_cast(esize), *GlobalTables::GetTypeTable().GetTypeFromTyIdx(TyIdx(array.GetPrimType()))); rMul = mirModule.CurFuncCodeMemPool()->New(econst); rMul->SetPrimType(array.GetPrimType()); if (dim == 1 && array.GetBase()->op == OP_addrof) { opadd = OP_CG_array_elem_add; } } else { - MIRIntConst *econst = mirModule.GetMemPool()->New( - esize, - *GlobalTables::GetTypeTable().GetTypeFromTyIdx(TyIdx(array.GetPrimType()))); + MIRIntConst *econst = mirModule.GetMemPool()->New(esize, + *GlobalTables::GetTypeTable().GetTypeFromTyIdx(TyIdx(array.GetPrimType()))); BaseNode *eSize = mirModule.CurFuncCodeMemPool()->New(econst); eSize->SetPrimType(array.GetPrimType()); rMul = mirModule.CurFuncCodeMemPool()->New(OP_mul); diff --git a/src/mapleall/maple_be/src/cg/aarch64/aarch64_cgfunc.cpp b/src/mapleall/maple_be/src/cg/aarch64/aarch64_cgfunc.cpp index 88bd7e6f79d109c555f2ac2937a9fec14d3cfa98..599d62b9513ab676908c4cd63ded47e1cb6dc96f 100644 --- a/src/mapleall/maple_be/src/cg/aarch64/aarch64_cgfunc.cpp +++ b/src/mapleall/maple_be/src/cg/aarch64/aarch64_cgfunc.cpp @@ -2309,31 +2309,31 @@ Operand &AArch64CGFunc::SelectCGArrayElemAdd(BinaryNode &node) { ASSERT(opnd1->GetOpCode() == OP_constval, "Internal error, opnd1->op should be OP_constval."); switch (opnd0->op) { - case OP_regread: { - RegreadNode *regreadNode = static_cast(opnd0); - return *SelectRegread(*regreadNode); - } - case OP_addrof: { - AddrofNode *addrofNode = static_cast(opnd0); - MIRSymbol &symbol = *mirModule.CurFunction()->GetLocalOrGlobalSymbol(addrofNode->GetStIdx()); - ASSERT(addrofNode->GetFieldID() == 0, "For debug SelectCGArrayElemAdd."); + case OP_regread: { + RegreadNode *regreadNode = static_cast(opnd0); + return *SelectRegread(*regreadNode); + } + case OP_addrof: { + AddrofNode *addrofNode = static_cast(opnd0); + MIRSymbol &symbol = *mirModule.CurFunction()->GetLocalOrGlobalSymbol(addrofNode->GetStIdx()); + ASSERT(addrofNode->GetFieldID() == 0, "For debug SelectCGArrayElemAdd."); - PrimType primType = addrofNode->GetPrimType(); - regno_t vRegNo = NewVReg(kRegTyInt, GetPrimTypeSize(primType)); - Operand &result = CreateVirtualRegisterOperand(vRegNo); + PrimType primType = addrofNode->GetPrimType(); + regno_t vRegNo = NewVReg(kRegTyInt, GetPrimTypeSize(primType)); + Operand &result = CreateVirtualRegisterOperand(vRegNo); - // OP_constval - ConstvalNode *constvalNode = static_cast(opnd1); - MIRConst *mirConst = constvalNode->GetConstVal(); - MIRIntConst *mirIntConst = static_cast(mirConst); - SelectAddrof(result, CreateStImmOperand(symbol, mirIntConst->GetValue(), 0)); + // OP_constval + ConstvalNode *constvalNode = static_cast(opnd1); + MIRConst *mirConst = constvalNode->GetConstVal(); + MIRIntConst *mirIntConst = static_cast(mirConst); + SelectAddrof(result, CreateStImmOperand(symbol, mirIntConst->GetValue(), 0)); - return result; - } - default: - CHECK_FATAL(0, "Internal error, cannot handle opnd0."); + return result; + } + default: + CHECK_FATAL(0, "Internal error, cannot handle opnd0."); } - } +} void AArch64CGFunc::SelectSub(Operand &resOpnd, Operand &opnd0, Operand &opnd1, PrimType primType) { Operand::OperandType opnd1Type = opnd1.GetKind(); diff --git a/src/mapleall/maple_be/src/cg/emit.cpp b/src/mapleall/maple_be/src/cg/emit.cpp index b25607e52e7fbea30b128534ac68340fff903c48..6d8e497b2d3c7ca786c1a8f40805aab9ac6510d7 100644 --- a/src/mapleall/maple_be/src/cg/emit.cpp +++ b/src/mapleall/maple_be/src/cg/emit.cpp @@ -495,7 +495,7 @@ void Emitter::EmitStrConstant(const MIRStrConst &mirStrConst, bool isIndirect) { const std::string ustr = GlobalTables::GetUStrTable().GetStringFromStrIdx(mirStrConst.GetValue()); size_t len = ustr.size(); if (isFlexibleArray) { - arraySize += len + 1; + arraySize += static_cast(len) + 1; } EmitStr(ustr, false, false); } diff --git a/src/mapleall/maple_me/include/alias_class.h b/src/mapleall/maple_me/include/alias_class.h index c8f7cacb8de47c2f4878bb4bf0566cd2d7591a38..9a845e335cb2d18762d935ce5d38d8265670eab8 100644 --- a/src/mapleall/maple_me/include/alias_class.h +++ b/src/mapleall/maple_me/include/alias_class.h @@ -1,5 +1,5 @@ /* - * Copyright (c) [2019-2020] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2019-2021] Huawei Technologies Co.,Ltd.All rights reserved. * * OpenArkCompiler is licensed under Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/mapleall/maple_me/include/dominance.h b/src/mapleall/maple_me/include/dominance.h index f00e779e305d4f49816d3ef3736a8ef83dfc8cb3..13e3fc575315c9e4fe23290c07bbf08c95bf6963 100644 --- a/src/mapleall/maple_me/include/dominance.h +++ b/src/mapleall/maple_me/include/dominance.h @@ -1,5 +1,5 @@ /* - * Copyright (c) [2019-2020] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2019-2021] Huawei Technologies Co.,Ltd.All rights reserved. * * OpenArkCompiler is licensed under Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. @@ -50,7 +50,7 @@ class Dominance : public AnalysisResult { void ComputeDominance(); void ComputeDomFrontiers(); void ComputeDomChildren(); - void GetIterDomFrontier(BB *bb, MapleSet *dfset, BBId bbidMarker, std::vector &visitedMap); + void GetIterDomFrontier(const BB *bb, MapleSet *dfset, BBId bbidMarker, std::vector &visitedMap); void ComputeIterDomFrontiers(); void ComputeDtPreorder(const BB &bb, size_t &num); void ComputeDtDfn(); @@ -60,7 +60,7 @@ class Dominance : public AnalysisResult { void ComputePostDominance(); void ComputePdomFrontiers(); void ComputePdomChildren(); - void GetIterPdomFrontier(BB *bb, MapleSet *dfset, BBId bbidMarker, std::vector &visitedMap); + void GetIterPdomFrontier(const BB *bb, MapleSet *dfset, BBId bbidMarker, std::vector &visitedMap); void ComputeIterPdomFrontiers(); void ComputePdtPreorder(const BB &bb, size_t &num); void ComputePdtDfn(); diff --git a/src/mapleall/maple_me/include/irmap_build.h b/src/mapleall/maple_me/include/irmap_build.h index ece71920a29552fe904591fd590218a7759ed2c9..9d0a1ecf7b5aeb0505a70eb8479bae3468b04ee6 100644 --- a/src/mapleall/maple_me/include/irmap_build.h +++ b/src/mapleall/maple_me/include/irmap_build.h @@ -38,11 +38,11 @@ class IRMapBuild { void BuildBB(BB &bb, std::vector &bbIRMapProcessed); private: - VarMeExpr *GetOrCreateVarFromVerSt(VersionSt &vst); - RegMeExpr *GetOrCreateRegFromVerSt(VersionSt &vst); + VarMeExpr *GetOrCreateVarFromVerSt(const VersionSt &vst); + RegMeExpr *GetOrCreateRegFromVerSt(const VersionSt &vst); - MeExpr *BuildLHSVar(VersionSt &vst, DassignMeStmt &defMeStmt); - MeExpr *BuildLHSReg(VersionSt &vst, RegassignMeStmt &defMeStmt, const RegassignNode ®assign); + MeExpr *BuildLHSVar(const VersionSt &vst, DassignMeStmt &defMeStmt); + MeExpr *BuildLHSReg(const VersionSt &vst, RegassignMeStmt &defMeStmt, const RegassignNode ®assign); void BuildChiList(MeStmt&, TypeOfMayDefList&, MapleMap&); void BuildMustDefList(MeStmt &meStmt, TypeOfMustDefList&, MapleVector&); void BuildMuList(TypeOfMayUseList&, MapleMap&); diff --git a/src/mapleall/maple_me/include/me_abco.h b/src/mapleall/maple_me/include/me_abco.h index d006dc18bc9d95714775357a4009a91e03a120f4..4f95b4195a9745369e4315a7cca526df41a7bd26 100644 --- a/src/mapleall/maple_me/include/me_abco.h +++ b/src/mapleall/maple_me/include/me_abco.h @@ -1,5 +1,5 @@ /* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2020-2021] Huawei Technologies Co.,Ltd.All rights reserved. * * OpenArkCompiler is licensed under Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/mapleall/maple_me/include/me_ssa.h b/src/mapleall/maple_me/include/me_ssa.h index 17040ae23f8559801216d670e00365e1416b654f..0cad346c686cede5f007a44d7671b37a43959de9 100644 --- a/src/mapleall/maple_me/include/me_ssa.h +++ b/src/mapleall/maple_me/include/me_ssa.h @@ -1,5 +1,5 @@ /* - * Copyright (c) [2019] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2019-2021] Huawei Technologies Co.,Ltd.All rights reserved. * * OpenArkCompiler is licensed under Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. @@ -24,8 +24,10 @@ namespace maple { class MeSSA : public SSA, public AnalysisResult { public: - MeSSA(MeFunction &func, SSATab *stab, Dominance &dom, MemPool &memPool) : - SSA(memPool, *stab, func.GetAllBBs(), &dom), AnalysisResult(&memPool), func(&func), dom(&dom) {} + MeSSA(MeFunction &func, SSATab *stab, Dominance &dom, MemPool &memPool) + : SSA(memPool, *stab, func.GetAllBBs(), &dom), + AnalysisResult(&memPool), + func(&func) {} ~MeSSA() = default; @@ -35,7 +37,6 @@ class MeSSA : public SSA, public AnalysisResult { private: void VerifySSAOpnd(const BaseNode &node) const; MeFunction *func; - Dominance *dom; }; class MeDoSSA : public MeFuncPhase { diff --git a/src/mapleall/maple_me/include/occur.h b/src/mapleall/maple_me/include/occur.h index 695be3b9a8f4132a99bc707ffc8639014a278d25..fe49e473199ee553d495c787205b75490624f536 100644 --- a/src/mapleall/maple_me/include/occur.h +++ b/src/mapleall/maple_me/include/occur.h @@ -1,5 +1,5 @@ /* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2020-2021] Huawei Technologies Co.,Ltd.All rights reserved. * * OpenArkCompiler is licensed under Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/mapleall/maple_me/include/ssa.h b/src/mapleall/maple_me/include/ssa.h index 35d4c126da7bdbcdc579405d153308bd4a169cbc..111111fd03de42a5bbd01e3993c148c05d79242a 100644 --- a/src/mapleall/maple_me/include/ssa.h +++ b/src/mapleall/maple_me/include/ssa.h @@ -1,5 +1,5 @@ /* - * Copyright (c) [2019-2020] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2019-2021] Huawei Technologies Co.,Ltd.All rights reserved. * * OpenArkCompiler is licensed under Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. @@ -90,7 +90,7 @@ class SSA { virtual ~SSA() = default; - void InitRenameStack(OriginalStTable&, size_t, VersionStTable&); + void InitRenameStack(const OriginalStTable&, size_t, const VersionStTable&); VersionSt *CreateNewVersion(VersionSt &vSym, BB &defBB); void RenamePhi(BB &bb); void RenameDefs(StmtNode &stmt, BB &defBB); diff --git a/src/mapleall/maple_me/include/ssa_mir_nodes.h b/src/mapleall/maple_me/include/ssa_mir_nodes.h index 605297adfe00e85ac127a8259d9a9bd513f73dc9..46c936e453e2c03360f23a92a9f924d9c36f3405 100644 --- a/src/mapleall/maple_me/include/ssa_mir_nodes.h +++ b/src/mapleall/maple_me/include/ssa_mir_nodes.h @@ -1,5 +1,5 @@ /* - * Copyright (c) [2019-2020] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2019-2021] Huawei Technologies Co.,Ltd.All rights reserved. * * OpenArkCompiler is licensed under Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/mapleall/maple_me/include/ssa_tab.h b/src/mapleall/maple_me/include/ssa_tab.h index f7b34be5f752ed35dee796f96b379f39067d4c91..346610c5b7abeed1e558136d57edda5cdf07f52f 100644 --- a/src/mapleall/maple_me/include/ssa_tab.h +++ b/src/mapleall/maple_me/include/ssa_tab.h @@ -36,7 +36,7 @@ class SSATab : public AnalysisResult { ~SSATab() = default; BaseNode *CreateSSAExpr(BaseNode &expr); - void CreateSSAStmt(StmtNode &stmt, BB *curbb); + void CreateSSAStmt(StmtNode &stmt, const BB *curbb); bool HasDefBB(OStIdx oidx) { return oidx < defBBs4Ost.size() && defBBs4Ost[oidx] && !defBBs4Ost[oidx]->empty(); } @@ -47,7 +47,7 @@ class SSATab : public AnalysisResult { if (defBBs4Ost[oidx] == nullptr) { defBBs4Ost[oidx] = versAlloc.GetMemPool()->New>(versAlloc.Adapter()); } - defBBs4Ost[oidx]->insert(bbid); + (void)defBBs4Ost[oidx]->insert(bbid); } MapleSet *GetDefBBs4Ost(OStIdx oidx) { return defBBs4Ost[oidx]; diff --git a/src/mapleall/maple_me/include/ver_symbol.h b/src/mapleall/maple_me/include/ver_symbol.h index 769cea87c257bb5526fdf20909f5f8982937dbc5..79c0d62321cb0827c4bb53963484bacfe67a683d 100644 --- a/src/mapleall/maple_me/include/ver_symbol.h +++ b/src/mapleall/maple_me/include/ver_symbol.h @@ -176,7 +176,7 @@ class VersionStTable { void CreateZeroVersionSt(OriginalSt *ost); - VersionSt *GetZeroVersionSt(OriginalSt *ost) { + VersionSt *GetZeroVersionSt(const OriginalSt *ost) const { CHECK_FATAL(ost->GetVersionsIndices().size() != 0, "GetZeroVersionSt:: zero version has not been created"); return versionStVector[ost->GetZeroVersionIndex()]; } diff --git a/src/mapleall/maple_me/src/alias_class.cpp b/src/mapleall/maple_me/src/alias_class.cpp index 79287da29d2d5a217b3b7140d6a919d6ce7cdd9c..a103cf3c0cabc614ff0449287fe0806f9f8e4d32 100644 --- a/src/mapleall/maple_me/src/alias_class.cpp +++ b/src/mapleall/maple_me/src/alias_class.cpp @@ -753,8 +753,8 @@ void AliasClass::InsertMayUseAll(const StmtNode &stmt) { TypeOfMayUseList &mayUseNodes = ssaTab.GetStmtsSSAPart().GetMayUseNodesOf(stmt); for (AliasElem *aliasElem : id2Elem) { if (aliasElem->GetOriginalSt().GetIndirectLev() >= 0 && !aliasElem->GetOriginalSt().IsPregOst()) { - mayUseNodes.emplace_back( - MayUseNode(ssaTab.GetVersionStTable().GetVersionStVectorItem(aliasElem->GetOriginalSt().GetZeroVersionIndex()))); + mayUseNodes.emplace_back(MayUseNode( + ssaTab.GetVersionStTable().GetVersionStVectorItem(aliasElem->GetOriginalSt().GetZeroVersionIndex()))); } } } diff --git a/src/mapleall/maple_me/src/dominance.cpp b/src/mapleall/maple_me/src/dominance.cpp index fca5116a3a205582dadcf8f2fcadee15b3a122fe..f75f818da8393364232aced4dd930793cd7cc729 100644 --- a/src/mapleall/maple_me/src/dominance.cpp +++ b/src/mapleall/maple_me/src/dominance.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) [2019-2020] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2019-2021] Huawei Technologies Co.,Ltd.All rights reserved. * * OpenArkCompiler is licensed under Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. @@ -141,13 +141,14 @@ void Dominance::ComputeDomChildren() { // bbidMarker indicates that the iterDomFrontier results for bbid < bbidMarker // have been computed -void Dominance::GetIterDomFrontier(BB *bb, MapleSet *dfset, BBId bbidMarker, std::vector &visitedMap) { +void Dominance::GetIterDomFrontier(const BB *bb, MapleSet *dfset, BBId bbidMarker, + std::vector &visitedMap) { if (visitedMap[bb->GetBBId()]) { return; } visitedMap[bb->GetBBId()] = true; for (BBId frontierbbid : domFrontier[bb->GetBBId()]) { - dfset->insert(frontierbbid); + (void)dfset->insert(frontierbbid); if (frontierbbid < bbidMarker) { // union with its computed result dfset->insert(iterDomFrontier[frontierbbid].begin(), iterDomFrontier[frontierbbid].end()); } else { // recursive call @@ -323,13 +324,14 @@ void Dominance::ComputePdomChildren() { // bbidMarker indicates that the iterPdomFrontier results for bbid < bbidMarker // have been computed -void Dominance::GetIterPdomFrontier(BB *bb, MapleSet *dfset, BBId bbidMarker, std::vector &visitedMap) { +void Dominance::GetIterPdomFrontier(const BB *bb, MapleSet *dfset, BBId bbidMarker, + std::vector &visitedMap) { if (visitedMap[bb->GetBBId()]) { return; } visitedMap[bb->GetBBId()] = true; for (BBId frontierbbid : pdomFrontier[bb->GetBBId()]) { - dfset->insert(frontierbbid); + (void)dfset->insert(frontierbbid); if (frontierbbid < bbidMarker) { // union with its computed result dfset->insert(iterPdomFrontier[frontierbbid].begin(), iterPdomFrontier[frontierbbid].end()); } else { // recursive call diff --git a/src/mapleall/maple_me/src/irmap_build.cpp b/src/mapleall/maple_me/src/irmap_build.cpp index c2287f8ec237b12fb9a96a32bf4ef7e120bd3b28..62675028e1ff673a233b732a1ea3ded81f624b56 100644 --- a/src/mapleall/maple_me/src/irmap_build.cpp +++ b/src/mapleall/maple_me/src/irmap_build.cpp @@ -23,7 +23,7 @@ namespace maple { using MeExprBuildFactory = FunctionFactory; using MeStmtFactory = FunctionFactory; -VarMeExpr *IRMapBuild::GetOrCreateVarFromVerSt(VersionSt &vst) { +VarMeExpr *IRMapBuild::GetOrCreateVarFromVerSt(const VersionSt &vst) { size_t vindex = vst.GetIndex(); ASSERT(vindex < irMap->vst2MeExprTable.size(), "GetOrCreateVarFromVerSt: index %d is out of range", vindex); MeExpr *meExpr = irMap->vst2MeExprTable.at(vindex); @@ -39,7 +39,7 @@ VarMeExpr *IRMapBuild::GetOrCreateVarFromVerSt(VersionSt &vst) { return varx; } -RegMeExpr *IRMapBuild::GetOrCreateRegFromVerSt(VersionSt &vst) { +RegMeExpr *IRMapBuild::GetOrCreateRegFromVerSt(const VersionSt &vst) { size_t vindex = vst.GetIndex(); ASSERT(vindex < irMap->vst2MeExprTable.size(), " GetOrCreateRegFromVerSt: index %d is out of range", vindex); MeExpr *meExpr = irMap->vst2MeExprTable[vindex]; @@ -54,7 +54,7 @@ RegMeExpr *IRMapBuild::GetOrCreateRegFromVerSt(VersionSt &vst) { return regx; } -MeExpr *IRMapBuild::BuildLHSVar(VersionSt &vst, DassignMeStmt &defMeStmt) { +MeExpr *IRMapBuild::BuildLHSVar(const VersionSt &vst, DassignMeStmt &defMeStmt) { VarMeExpr *meDef = GetOrCreateVarFromVerSt(vst); meDef->SetDefStmt(&defMeStmt); meDef->SetDefBy(kDefByStmt); @@ -62,7 +62,7 @@ MeExpr *IRMapBuild::BuildLHSVar(VersionSt &vst, DassignMeStmt &defMeStmt) { return meDef; } -MeExpr *IRMapBuild::BuildLHSReg(VersionSt &vst, RegassignMeStmt &defMeStmt, const RegassignNode ®assign) { +MeExpr *IRMapBuild::BuildLHSReg(const VersionSt &vst, RegassignMeStmt &defMeStmt, const RegassignNode ®assign) { RegMeExpr *meDef = GetOrCreateRegFromVerSt(vst); meDef->SetPtyp(regassign.GetPrimType()); meDef->SetDefStmt(&defMeStmt); diff --git a/src/mapleall/maple_me/src/me_dominance.cpp b/src/mapleall/maple_me/src/me_dominance.cpp index 3f0e968cf571142760d68d4fb5acdbf8dab72deb..20f2832d131922c18b73bc24279749ef54f29baf 100644 --- a/src/mapleall/maple_me/src/me_dominance.cpp +++ b/src/mapleall/maple_me/src/me_dominance.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) [2019-2020] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2019-2021] Huawei Technologies Co.,Ltd.All rights reserved. * * OpenArkCompiler is licensed under Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/mapleall/maple_me/src/me_rc_lowering.cpp b/src/mapleall/maple_me/src/me_rc_lowering.cpp index 4f41cc1f4ef570dd8a3f8ced4bce148247978286..f37ce5cb5f839244f73654f9760b492e615826fd 100644 --- a/src/mapleall/maple_me/src/me_rc_lowering.cpp +++ b/src/mapleall/maple_me/src/me_rc_lowering.cpp @@ -15,6 +15,7 @@ #include "me_rc_lowering.h" #include #include "me_option.h" +#include "dominance.h" // RCLowering phase generate RC intrinsic for reference assignment // based on previous analyze results. RC intrinsic will later be lowered diff --git a/src/mapleall/maple_me/src/me_ssa.cpp b/src/mapleall/maple_me/src/me_ssa.cpp index b17f52639ddff9196d5f30f9ea391e258e980d1a..f9f265516ca69f4ed384c6e9d3bc75092bd1da2e 100644 --- a/src/mapleall/maple_me/src/me_ssa.cpp +++ b/src/mapleall/maple_me/src/me_ssa.cpp @@ -45,7 +45,6 @@ // returns from those recursive calls, we restores the stack of current SSA names to // the state that existed before the current block was visited. namespace maple { - void MeSSA::InsertPhiNode() { for (size_t i = 1; i < ssaTab->GetOriginalStTable().Size(); ++i) { OriginalSt *ost = ssaTab->GetOriginalStFromID(OStIdx(i)); @@ -121,7 +120,8 @@ AnalysisResult *MeDoSSA::Run(MeFunction *func, MeFuncResultMgr *funcResMgr, Modu ssa->InsertPhiNode(); - ssa->InitRenameStack(func->GetMeSSATab()->GetOriginalStTable(), func->GetAllBBs().size(), func->GetMeSSATab()->GetVersionStTable()); + ssa->InitRenameStack(func->GetMeSSATab()->GetOriginalStTable(), func->GetAllBBs().size(), + func->GetMeSSATab()->GetVersionStTable()); // recurse down dominator tree in pre-order traversal MapleSet *children = &dom->domChildren[func->GetCommonEntryBB()->GetBBId()]; diff --git a/src/mapleall/maple_me/src/me_ssa_tab.cpp b/src/mapleall/maple_me/src/me_ssa_tab.cpp index b34372132f3b23f011928861c905b466340e7f4a..334654f8cf04bbba0ebf0210adb96c9e4d328ec1 100644 --- a/src/mapleall/maple_me/src/me_ssa_tab.cpp +++ b/src/mapleall/maple_me/src/me_ssa_tab.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) [2019-2020] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2019-2021] Huawei Technologies Co.,Ltd.All rights reserved. * * OpenArkCompiler is licensed under Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/mapleall/maple_me/src/me_ssa_update.cpp b/src/mapleall/maple_me/src/me_ssa_update.cpp index ac4357fbcbfd2352ef9e97ec1314110a5f0acf81..4baabe1f2cc64ce8bc32ba53eab1a87e16979952 100644 --- a/src/mapleall/maple_me/src/me_ssa_update.cpp +++ b/src/mapleall/maple_me/src/me_ssa_update.cpp @@ -22,7 +22,6 @@ // phi operands. namespace maple { - void MeSSAUpdate::InsertPhis() { MapleMap *>::iterator it = updateCands.begin(); MapleSet dfSet(ssaUpdateAlloc.Adapter()); diff --git a/src/mapleall/maple_me/src/me_stmt_fre.cpp b/src/mapleall/maple_me/src/me_stmt_fre.cpp index bce4839118cf5988202a791444ffce01a51cc8e8..576e3bd2a6c09d24e465e44df4a2f7a971b9b9e4 100644 --- a/src/mapleall/maple_me/src/me_stmt_fre.cpp +++ b/src/mapleall/maple_me/src/me_stmt_fre.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2020-2021] Huawei Technologies Co.,Ltd.All rights reserved. * * OpenArkCompiler is licensed under Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/mapleall/maple_me/src/ssa.cpp b/src/mapleall/maple_me/src/ssa.cpp index 99e56e9241180ba4520f191410bbf4188cb29f42..77021ae62abc055055f43e6ef5ef0d6b2dc0c831 100644 --- a/src/mapleall/maple_me/src/ssa.cpp +++ b/src/mapleall/maple_me/src/ssa.cpp @@ -20,7 +20,7 @@ #include "dominance.h" namespace maple { -void SSA::InitRenameStack(OriginalStTable &oTable, size_t bbSize, VersionStTable &verStTab) { +void SSA::InitRenameStack(const OriginalStTable &oTable, size_t bbSize, const VersionStTable &verStTab) { vstStacks.resize(oTable.Size()); bbRenamed.resize(bbSize, false); for (size_t i = 1; i < oTable.Size(); ++i) { diff --git a/src/mapleall/maple_me/src/ssa_tab.cpp b/src/mapleall/maple_me/src/ssa_tab.cpp index c83029a254b3b175f78ccb03c390a083934410a8..7405f2dc0b0b416a70be868970a542da787483f8 100644 --- a/src/mapleall/maple_me/src/ssa_tab.cpp +++ b/src/mapleall/maple_me/src/ssa_tab.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) [2019-2020] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2019-2021] Huawei Technologies Co.,Ltd.All rights reserved. * * OpenArkCompiler is licensed under Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. @@ -63,7 +63,7 @@ BaseNode *SSATab::CreateSSAExpr(BaseNode &expr) { return nullptr; } -void SSATab::CreateSSAStmt(StmtNode &stmt, BB *curbb) { +void SSATab::CreateSSAStmt(StmtNode &stmt, const BB *curbb) { for (size_t i = 0; i < stmt.NumOpnds(); ++i) { BaseNode *newOpnd = CreateSSAExpr(*stmt.Opnd(i)); if (newOpnd != nullptr) { @@ -133,7 +133,8 @@ void SSATab::CreateSSAStmt(StmtNode &stmt, BB *curbb) { MIRSymbol *st = symTab->GetSymbolFromStIdx(stidx.Idx()); ost = FindOrCreateSymbolOriginalSt(*st, mirModule.CurFunction()->GetPuidx(), retPair.second.GetFieldID()); } else { - ost = originalStTable.FindOrCreatePregOriginalSt(retPair.second.GetPregIdx(), mirModule.CurFunction()->GetPuidx()); + ost = originalStTable.FindOrCreatePregOriginalSt(retPair.second.GetPregIdx(), + mirModule.CurFunction()->GetPuidx()); } versionStTable.CreateZeroVersionSt(ost); VersionSt *vst = versionStTable.GetZeroVersionSt(ost); diff --git a/src/mapleall/maple_me/src/ver_symbol.cpp b/src/mapleall/maple_me/src/ver_symbol.cpp index 7b71e03cf0dc726fc33a97a68601954323a30891..811032287e35028a6406234add833c2393a5873b 100644 --- a/src/mapleall/maple_me/src/ver_symbol.cpp +++ b/src/mapleall/maple_me/src/ver_symbol.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) [2019-2020] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2019-2021] Huawei Technologies Co.,Ltd.All rights reserved. * * OpenArkCompiler is licensed under Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. @@ -18,7 +18,6 @@ #include "ssa_mir_nodes.h" namespace maple { - void VersionSt::DumpDefStmt(const MIRModule*) const { if (version <= 0) { return; diff --git a/src/mrt/deplibs/libmplandroid.so b/src/mrt/deplibs/libmplandroid.so index 49df0d0ec621f77659c540b030f5bb9511b130e1..78b3e4f0b9526692bbb9b4a425aaeacb707d0c6f 100755 Binary files a/src/mrt/deplibs/libmplandroid.so and b/src/mrt/deplibs/libmplandroid.so differ