diff --git a/src/mapleall/maple_ir/include/mir_parser.h b/src/mapleall/maple_ir/include/mir_parser.h index a6927c2938be14002c1d9438881724ceff9f3cd0..d427a9107e8fe34d8107081e2e277d512ca6a83d 100644 --- a/src/mapleall/maple_ir/include/mir_parser.h +++ b/src/mapleall/maple_ir/include/mir_parser.h @@ -142,6 +142,7 @@ class MIRParser { bool ParseUnaryStmtDecRef(StmtNodePtr&); bool ParseUnaryStmtIncRef(StmtNodePtr&); bool ParseUnaryStmtDecRefReset(StmtNodePtr&); + bool ParseUnaryStmtIGoto(StmtNodePtr&); bool ParseUnaryStmtEval(StmtNodePtr&); bool ParseUnaryStmtFree(StmtNodePtr&); bool ParseUnaryStmtAssertNonNull(StmtNodePtr&); diff --git a/src/mapleall/maple_ir/include/opcodes.h b/src/mapleall/maple_ir/include/opcodes.h index 59d07c8c8bebd10b0303fac7a3261135164122d6..17f3e3e533e0c34b94c6b9e8f9e281ccc3ab2618 100644 --- a/src/mapleall/maple_ir/include/opcodes.h +++ b/src/mapleall/maple_ir/include/opcodes.h @@ -39,7 +39,7 @@ inline constexpr bool IsCallAssigned(Opcode code) { } inline constexpr bool IsBranch(Opcode opcode) { - return (opcode == OP_goto || opcode == OP_brtrue || opcode == OP_brfalse || opcode == OP_switch); + return (opcode == OP_goto || opcode == OP_brtrue || opcode == OP_brfalse || opcode == OP_switch || opcode == OP_igoto); } constexpr bool IsCommutative(Opcode opcode) { diff --git a/src/mapleall/maple_ir/src/mir_parser.cpp b/src/mapleall/maple_ir/src/mir_parser.cpp index 4c928e845053342a58b541f93c978646bfeed21f..6db91aa6d7b4377bd5630cbd9db7319eb6956a21 100644 --- a/src/mapleall/maple_ir/src/mir_parser.cpp +++ b/src/mapleall/maple_ir/src/mir_parser.cpp @@ -1184,6 +1184,10 @@ bool MIRParser::ParseUnaryStmtDecRefReset(StmtNodePtr &stmt) { return ParseUnaryStmt(OP_decrefreset, stmt); } +bool MIRParser::ParseUnaryStmtIGoto(StmtNodePtr &stmt) { + return ParseUnaryStmt(OP_igoto, stmt); +} + bool MIRParser::ParseUnaryStmtEval(StmtNodePtr &stmt) { return ParseUnaryStmt(OP_eval, stmt); } @@ -2267,6 +2271,7 @@ bool MIRParser::ParseExprAddroflabel(BaseNodePtr &expr) { } LabelIdx lblIdx = mod.CurFunction()->GetOrCreateLableIdxFromName(lexer.GetName()); addrOfLabelNode->SetOffset(lblIdx); + mod.CurFunction()->GetLabelTab()->GetAddrTakenLabels().insert(lblIdx); lexer.NextToken(); return true; } @@ -2628,8 +2633,8 @@ bool MIRParser::ParseConstAddrLeafExpr(MIRConstPtr &cexpr) { return false; } CHECK_FATAL(expr != nullptr, "null ptr check"); - if (expr->GetOpCode() != OP_addrof && expr->GetOpCode() != OP_addroffunc && expr->GetOpCode() != OP_conststr && - expr->GetOpCode() != OP_conststr16) { + if (expr->GetOpCode() != OP_addrof && expr->GetOpCode() != OP_addroffunc && expr->GetOpCode() != OP_addroflabel && + expr->GetOpCode() != OP_conststr && expr->GetOpCode() != OP_conststr16) { Error("ParseConstAddrLeafExpr expects one of OP_addrof, OP_addroffunc, OP_conststr and OP_conststr16"); return false; } @@ -2643,7 +2648,23 @@ bool MIRParser::ParseConstAddrLeafExpr(MIRConstPtr &cexpr) { MIRPtrType ptrType(ptyIdx, (mod.IsJavaModule() ? PTY_ref : PTY_ptr)); ptyIdx = GlobalTables::GetTypeTable().GetOrCreateMIRType(&ptrType); MIRType *exprTy = GlobalTables::GetTypeTable().GetTypeFromTyIdx(ptyIdx); - cexpr = mod.CurFuncCodeMemPool()->New(anode->GetStIdx(), anode->GetFieldID(), *exprTy); + int32 ofst = 0; + if (lexer.GetTokenKind() == TK_lparen) { + lexer.NextToken(); + if (lexer.GetTokenKind() != TK_intconst) { + Error("ParseConstAddrLeafExpr: wrong offset specification for addrof"); + return false; + } else { + ofst = lexer.GetTheIntVal(); + } + lexer.NextToken(); + if (lexer.GetTokenKind() != TK_rparen) { + Error("ParseConstAddrLeafExpr expects closing paren after offset value for addrof"); + return false; + } + lexer.NextToken(); + } + cexpr = mod.CurFuncCodeMemPool()->New(anode->GetStIdx(), anode->GetFieldID(), *exprTy, ofst); } else if (expr->GetOpCode() == OP_addroffunc) { auto *aof = static_cast(expr); MIRFunction *f = GlobalTables::GetFunctionTable().GetFunctionFromPuidx(aof->GetPUIdx()); @@ -2653,6 +2674,10 @@ bool MIRParser::ParseConstAddrLeafExpr(MIRConstPtr &cexpr) { ptyIdx = GlobalTables::GetTypeTable().GetOrCreateMIRType(&ptrType); MIRType *exprTy = GlobalTables::GetTypeTable().GetTypeFromTyIdx(ptyIdx); cexpr = mod.CurFuncCodeMemPool()->New(aof->GetPUIdx(), *exprTy); + } else if (expr->op == OP_addroflabel) { + AddroflabelNode *aol = static_cast(expr); + MIRType *mirtype = GlobalTables::GetTypeTable().GetTypeFromTyIdx(TyIdx(PTY_ptr)); + cexpr = mod.CurFuncCodeMemPool()->New(aol->GetOffset(), mod.CurFunction()->GetPuidx(), *mirtype); } else if (expr->GetOpCode() == OP_conststr) { auto *cs = static_cast(expr); UStrIdx stridx = cs->GetStrIdx(); @@ -2819,6 +2844,7 @@ std::map MIRParser::InitFuncPtrMapForPar funcPtrMap[TK_decref] = &MIRParser::ParseUnaryStmtDecRef; funcPtrMap[TK_incref] = &MIRParser::ParseUnaryStmtIncRef; funcPtrMap[TK_decrefreset] = &MIRParser::ParseUnaryStmtDecRefReset; + funcPtrMap[TK_igoto] = &MIRParser::ParseUnaryStmtIGoto; funcPtrMap[TK_jscatch] = &MIRParser::ParseStmtMarker; funcPtrMap[TK_finally] = &MIRParser::ParseStmtMarker; funcPtrMap[TK_cleanuptry] = &MIRParser::ParseStmtMarker; diff --git a/src/mapleall/maple_me/include/bb.h b/src/mapleall/maple_me/include/bb.h index 4b1ce8df7b57a1c413f0c4b007e83b82a4ab37d1..a51c239f1e6ebdbe875be395bd60a9e8252499cb 100755 --- a/src/mapleall/maple_me/include/bb.h +++ b/src/mapleall/maple_me/include/bb.h @@ -35,6 +35,7 @@ enum BBKind { kBBReturn, kBBAfterGosub, // the BB that follows a gosub, as it is an entry point kBBSwitch, + kBBIgoto, kBBInvalid }; diff --git a/src/mapleall/maple_me/include/irmap_build.h b/src/mapleall/maple_me/include/irmap_build.h index 1b72df86c3ee411a104668f96f10ded6832b4f94..799805ad01c36806cbc060740aaabe5bdf65e2d4 100644 --- a/src/mapleall/maple_me/include/irmap_build.h +++ b/src/mapleall/maple_me/include/irmap_build.h @@ -52,6 +52,7 @@ class IRMapBuild { } MeExpr *BuildAddrofMeExpr(BaseNode &mirNode) const; MeExpr *BuildAddroffuncMeExpr(BaseNode &mirNode) const; + MeExpr *BuildAddroflabelMeExpr(BaseNode &mirNode) const; MeExpr *BuildGCMallocMeExpr(BaseNode &mirNode) const; MeExpr *BuildSizeoftypeMeExpr(BaseNode &mirNode) const; MeExpr *BuildFieldsDistMeExpr(BaseNode &mirNode) const; diff --git a/src/mapleall/maple_me/include/me_ir.h b/src/mapleall/maple_me/include/me_ir.h index 4ef064ba4eb6b75d36f4ba218b5fc9395dcee096..46325f15b004787e683f9006600172ac0df9c28f 100755 --- a/src/mapleall/maple_me/include/me_ir.h +++ b/src/mapleall/maple_me/include/me_ir.h @@ -2353,7 +2353,7 @@ class RetMeStmt : public NaryMeStmt { MapleMap muList; }; -// eval, free, decref, incref, decrefreset, assertnonnull +// eval, free, decref, incref, decrefreset, assertnonnull, igoto class UnaryMeStmt : public MeStmt { public: explicit UnaryMeStmt(const StmtNode *stt) : MeStmt(stt) {} diff --git a/src/mapleall/maple_me/include/me_loop_canon.h b/src/mapleall/maple_me/include/me_loop_canon.h index d97e1d7091bcd8419d027c93e778f41d1b9efa33..5623e6e46cb27f63a5fb3ee4ff2906e473ab7566 100644 --- a/src/mapleall/maple_me/include/me_loop_canon.h +++ b/src/mapleall/maple_me/include/me_loop_canon.h @@ -35,7 +35,7 @@ class MeDoLoopCanon : public MeFuncPhase { using Key = std::pair; std::map> heads; void Convert(MeFunction &func, BB &bb, BB &pred, MapleMap &swapSuccs); - bool NeedConvert(BB &bb, BB &pred, MapleAllocator &alloc, MapleMap &swapSuccs) const; + bool NeedConvert(MeFunction *func, BB &bb, BB &pred, MapleAllocator &alloc, MapleMap &swapSuccs) const; void FindHeadBBs(MeFunction &func, Dominance &dom, const BB *bb); bool IsDoWhileLoop(MeFunction &func, const LoopDesc &loop) const; void Merge(MeFunction &func); diff --git a/src/mapleall/maple_me/src/bb.cpp b/src/mapleall/maple_me/src/bb.cpp index e48ed431aeb843ab4b91f32709d67a3bd797d9f4..71125e00869f13925a75e43dbe7fd270ccdf09f3 100755 --- a/src/mapleall/maple_me/src/bb.cpp +++ b/src/mapleall/maple_me/src/bb.cpp @@ -35,6 +35,8 @@ std::string BB::StrAttribute() const { return "aftergosub"; case kBBSwitch: return "switch"; + case kBBIgoto: + return "igoto"; case kBBInvalid: return "invalid"; default: @@ -331,7 +333,7 @@ void BB::InsertMeStmtLastBr(MeStmt *inStmt) { MeStmt *brStmt = meStmtList.rbegin().base().d(); Opcode op = brStmt->GetOp(); if (brStmt->IsCondBr() || op == OP_goto || op == OP_switch || op == OP_throw || op == OP_return || op == OP_gosub || - op == OP_retsub) { + op == OP_retsub || op == OP_igoto) { InsertMeStmtBefore(brStmt, inStmt); } else { AddMeStmtLast(inStmt); diff --git a/src/mapleall/maple_me/src/hdse.cpp b/src/mapleall/maple_me/src/hdse.cpp index afaf8aa96a3618c17908bc2af97cca4385f4bff3..dc44ffd44093d0feaf3248208ab1ffde0b43ec45 100755 --- a/src/mapleall/maple_me/src/hdse.cpp +++ b/src/mapleall/maple_me/src/hdse.cpp @@ -43,7 +43,7 @@ void HDSE::RemoveNotRequiredStmtsInBB(BB &bb) { mirModule.GetOut() << "========== HSSA DSE is deleting this stmt: "; meStmt.Dump(&irMap); } - if (meStmt.GetOp() != OP_dassign && (meStmt.IsCondBr() || meStmt.GetOp() == OP_switch)) { + if (meStmt.GetOp() != OP_dassign && (meStmt.IsCondBr() || meStmt.GetOp() == OP_switch || meStmt.GetOp() == OP_igoto)) { // update CFG while (bb.GetSucc().size() != 1) { BB *succ = bb.GetSucc().back(); @@ -378,7 +378,7 @@ void HDSE::MarkLastStmtInPDomBBRequired(const BB &bb) { } auto &lastStmt = cdBB->GetMeStmts().back(); Opcode op = lastStmt.GetOp(); - CHECK_FATAL((lastStmt.IsCondBr() || op == OP_switch || op == OP_retsub || op == OP_throw || + CHECK_FATAL((lastStmt.IsCondBr() || op == OP_switch || op == OP_igoto || op == OP_retsub || op == OP_throw || cdBB->GetAttributes(kBBAttrIsTry) || cdBB->GetAttributes(kBBAttrWontExit)), "HDSE::MarkLastStmtInPDomBBRequired: control dependent on unexpected statement"); if ((IsBranch(op) || op == OP_retsub || op == OP_throw)) { diff --git a/src/mapleall/maple_me/src/irmap.cpp b/src/mapleall/maple_me/src/irmap.cpp index b0ba280370d143f66f3e33c29fefd783aacb3ef9..69a56d99734615df1953a8bf8dbb6e881d258a2b 100644 --- a/src/mapleall/maple_me/src/irmap.cpp +++ b/src/mapleall/maple_me/src/irmap.cpp @@ -288,6 +288,9 @@ MeExpr *IRMap::HashMeExpr(MeExpr &meExpr) { case kMeOpAddroffunc: resultExpr = New(exprID, static_cast(meExpr).GetPuIdx()); break; + case kMeOpAddroflabel: + resultExpr = New(exprID, static_cast(meExpr).labelIdx); + break; case kMeOpGcmalloc: resultExpr = New(exprID, meExpr.GetOp(), meExpr.GetPrimType(), static_cast(meExpr).GetTyIdx()); break; diff --git a/src/mapleall/maple_me/src/irmap_build.cpp b/src/mapleall/maple_me/src/irmap_build.cpp index 0b34fdb9c972e5e34159dd9fb2dfddfc25ee1509..7cf01d7aa5a95f3e194019c325f4a8965252fb0a 100644 --- a/src/mapleall/maple_me/src/irmap_build.cpp +++ b/src/mapleall/maple_me/src/irmap_build.cpp @@ -169,6 +169,11 @@ MeExpr *IRMapBuild::BuildAddroffuncMeExpr(BaseNode &mirNode) const { return meExpr; } +MeExpr *IRMapBuild::BuildAddroflabelMeExpr(BaseNode &mirNode) const { + AddroflabelMeExpr *meExpr = new AddroflabelMeExpr(kInvalidExprID, static_cast(mirNode).GetOffset()); + return meExpr; +} + MeExpr *IRMapBuild::BuildGCMallocMeExpr(BaseNode &mirNode) const { GcmallocMeExpr *meExpr = new GcmallocMeExpr(kInvalidExprID, mirNode.GetOpCode(), mirNode.GetPrimType(), static_cast(mirNode).GetTyIdx()); return meExpr; @@ -325,6 +330,7 @@ MeExpr *IRMapBuild::BuildExpr(BaseNode &mirNode) { void IRMapBuild::InitMeExprBuildFactory() { RegisterFactoryFunction(OP_addrof, &IRMapBuild::BuildAddrofMeExpr); RegisterFactoryFunction(OP_addroffunc, &IRMapBuild::BuildAddroffuncMeExpr); + RegisterFactoryFunction(OP_addroflabel, &IRMapBuild::BuildAddroflabelMeExpr); RegisterFactoryFunction(OP_gcmalloc, &IRMapBuild::BuildGCMallocMeExpr); RegisterFactoryFunction(OP_gcpermalloc, &IRMapBuild::BuildGCMallocMeExpr); RegisterFactoryFunction(OP_sizeoftype, &IRMapBuild::BuildSizeoftypeMeExpr); @@ -422,6 +428,7 @@ MeStmt *IRMapBuild::BuildMeStmtWithNoSSAPart(StmtNode &stmt) { } case OP_assertnonnull: case OP_eval: + case OP_igoto: case OP_free: case OP_switch: { auto &unaryStmt = static_cast(stmt); diff --git a/src/mapleall/maple_me/src/irmap_emit.cpp b/src/mapleall/maple_me/src/irmap_emit.cpp index 5804bdd17ef3107a1e3fd78a247dc8c5b335f0c2..a5e4127080be186904764643c3f4480d690d1cf2 100755 --- a/src/mapleall/maple_me/src/irmap_emit.cpp +++ b/src/mapleall/maple_me/src/irmap_emit.cpp @@ -104,6 +104,13 @@ BaseNode &AddroffuncMeExpr::EmitExpr(SSATab &ssaTab) { return *addroffuncNode; } +BaseNode &AddroflabelMeExpr::EmitExpr(SSATab &ssaTab) { + auto *addroflabelNode = + ssaTab.GetModule().CurFunction()->GetCodeMempool()->New(labelIdx); + addroflabelNode->SetPrimType(PTY_ptr); + return *addroflabelNode; +} + BaseNode &GcmallocMeExpr::EmitExpr(SSATab &ssaTab) { auto *gcMallocNode = ssaTab.GetModule().CurFunction()->GetCodeMempool()->New( Opcode(GetOp()), PrimType(GetPrimType()), tyIdx); diff --git a/src/mapleall/maple_me/src/me_cfg.cpp b/src/mapleall/maple_me/src/me_cfg.cpp index f8d31e659d3e051f7a237411ce705d40c34b230d..c4332475217bf7543bb4ed1745415d83b147aa97 100755 --- a/src/mapleall/maple_me/src/me_cfg.cpp +++ b/src/mapleall/maple_me/src/me_cfg.cpp @@ -219,6 +219,13 @@ void MeCFG::BuildMirCFG() { } break; } + case kBBIgoto: { + for (LabelIdx lidx : func.GetMirFunc()->GetLabelTab()->GetAddrTakenLabels()) { + BB *mebb = func.GetLabelBBAt(lidx); + bb->AddSucc(*mebb); + } + break; + } case kBBReturn: break; default: { diff --git a/src/mapleall/maple_me/src/me_critical_edge.cpp b/src/mapleall/maple_me/src/me_critical_edge.cpp index 6542b5bfcede7bec402621583166181dc4c9ad3a..7aa2a81882849557d1ab837c5596376137aa43db 100644 --- a/src/mapleall/maple_me/src/me_critical_edge.cpp +++ b/src/mapleall/maple_me/src/me_critical_edge.cpp @@ -140,7 +140,7 @@ AnalysisResult *MeDoSplitCEdge::Run(MeFunction *func, MeFuncResultMgr *m, Module } // current BB is a merge for (BB *pred : preds) { - if (pred->GetKind() == kBBGoto) { + if (pred->GetKind() == kBBGoto || pred->GetKind() == kBBIgoto) { continue; } if (pred->GetSucc().size() > 1) { diff --git a/src/mapleall/maple_me/src/me_function.cpp b/src/mapleall/maple_me/src/me_function.cpp index 3603db736d9df7a7f8b648a81dbf9a05430493d8..1fabc1ae63eea5250b054a61f11566fa8d4f42c6 100755 --- a/src/mapleall/maple_me/src/me_function.cpp +++ b/src/mapleall/maple_me/src/me_function.cpp @@ -171,6 +171,17 @@ void MeFunction::CreateBasicBlocks() { } break; } + case OP_igoto: { + if (curBB->IsEmpty()) { + curBB->SetFirst(stmt); + } + curBB->SetLast(stmt); + curBB->SetKind(kBBIgoto); + if (nextStmt != nullptr) { + curBB = NewBasicBlock(); + } + break; + } case OP_dassign: { if (curBB->IsEmpty()) { curBB->SetFirst(stmt); diff --git a/src/mapleall/maple_me/src/me_ir.cpp b/src/mapleall/maple_me/src/me_ir.cpp index 53063c794100d0917aeaf48562d71ad6d1a5115c..b15580e8cc5435de58156ca18648aac427b39ea2 100755 --- a/src/mapleall/maple_me/src/me_ir.cpp +++ b/src/mapleall/maple_me/src/me_ir.cpp @@ -785,6 +785,12 @@ void AddroffuncMeExpr::Dump(const IRMap*, int32) const { LogInfo::MapleLogger() << " mx" << GetExprID(); } +void AddroflabelMeExpr::Dump(const IRMap *irMap, int32) const { + LogInfo::MapleLogger() << "ADDROFLABEL:"; + LogInfo::MapleLogger() << " @" << irMap->GetMIRModule().CurFunction()->GetLabelName(labelIdx); + LogInfo::MapleLogger() << " mx" << GetExprID(); +} + void GcmallocMeExpr::Dump(const IRMap*, int32) const { LogInfo::MapleLogger() << kOpcodeInfo.GetTableItemAt(GetOp()).name << " " << GetPrimTypeName(GetPrimType()); LogInfo::MapleLogger() << " "; diff --git a/src/mapleall/maple_me/src/me_loop_canon.cpp b/src/mapleall/maple_me/src/me_loop_canon.cpp index 39037cb541937eb47dfebe14837feff3bb91b5dc..3ed948c1f278d6e8123e5d2200ee38844a78d170 100644 --- a/src/mapleall/maple_me/src/me_loop_canon.cpp +++ b/src/mapleall/maple_me/src/me_loop_canon.cpp @@ -49,7 +49,7 @@ static bool CompareBackedge(const std::pair &a, const std::pairGetBBId() < (b.first)->GetBBId(); } -bool MeDoLoopCanon::NeedConvert(BB &bb, BB &pred, MapleAllocator &localAlloc, MapleMap &swapSuccs) const { +bool MeDoLoopCanon::NeedConvert(MeFunction *func, BB &bb, BB &pred, MapleAllocator &localAlloc, MapleMap &swapSuccs) const { bb.SetAttributes(kBBAttrIsInLoop); pred.SetAttributes(kBBAttrIsInLoop); // do not convert do-while loop @@ -57,6 +57,12 @@ bool MeDoLoopCanon::NeedConvert(BB &bb, BB &pred, MapleAllocator &localAlloc, Ma bb.GetAttributes(kBBAttrIsCatch)) { return false; } + if (bb.GetBBLabel() != 0) { + const MapleUnorderedSet &addrTakenLabels = func->GetMirFunc()->GetLabelTab()->GetAddrTakenLabels(); + if (addrTakenLabels.find(bb.GetBBLabel()) != addrTakenLabels.end()) { + return false; // target of igoto cannot be cloned + } + } ASSERT(bb.GetSucc().size() == 2, "the number of bb's successors must equal 2"); // if both succs are equal, return false if (bb.GetSucc().front() == bb.GetSucc().back()) { @@ -221,7 +227,7 @@ void MeDoLoopCanon::ExecuteLoopCanon(MeFunction &func, MeFuncResultMgr &m, Domin ASSERT_NOT_NULL(pred); // bb is reachable from entry && bb dominator pred if (dom.Dominate(*func.GetCommonEntryBB(), *bb) && dom.Dominate(*bb, *pred) && - !pred->GetAttributes(kBBAttrWontExit) && (NeedConvert(*bb, *pred, localAlloc, swapSuccs))) { + !pred->GetAttributes(kBBAttrWontExit) && (NeedConvert(&func, *bb, *pred, localAlloc, swapSuccs))) { if (DEBUGFUNC(&func)) { LogInfo::MapleLogger() << "find backedge " << bb->GetBBId() << " <-- " << pred->GetBBId() << '\n'; } diff --git a/src/mapleall/maple_me/src/me_ssa_lpre.cpp b/src/mapleall/maple_me/src/me_ssa_lpre.cpp index a66b027639594514f46b2f1b0668bb352a1dad02..473968850913ee7fd70045dee204bb8075e58839 100755 --- a/src/mapleall/maple_me/src/me_ssa_lpre.cpp +++ b/src/mapleall/maple_me/src/me_ssa_lpre.cpp @@ -325,6 +325,7 @@ void MeSSALPre::BuildWorkListExpr(MeStmt &meStmt, int32 seqStmt, MeExpr &meExpr, BuildWorkListExpr(meStmt, seqStmt, *ivarMeExpr->GetBase(), false, nullptr, false); break; } + case kMeOpAddroflabel: default: break; } diff --git a/src/mapleall/maple_me/src/me_stmt_pre.cpp b/src/mapleall/maple_me/src/me_stmt_pre.cpp index bc5af520f8539a821f51db60d21aa81362efd7f8..3c6552cdc6854cfeb1b77e3fc085b92013fb9365 100755 --- a/src/mapleall/maple_me/src/me_stmt_pre.cpp +++ b/src/mapleall/maple_me/src/me_stmt_pre.cpp @@ -850,6 +850,7 @@ void MeStmtPre::BuildWorkListBB(BB *bb) { case OP_brtrue: case OP_brfalse: case OP_switch: + case OP_igoto: break; case OP_membaracquire: case OP_membarrelease: diff --git a/src/mapleall/maple_me/src/occur.cpp b/src/mapleall/maple_me/src/occur.cpp index db5bae2b69fae1d12be974468cdecc10cba093df..61e3fe5aaf82735fffc85809763df1345d70235e 100755 --- a/src/mapleall/maple_me/src/occur.cpp +++ b/src/mapleall/maple_me/src/occur.cpp @@ -203,6 +203,7 @@ uint32 PreWorkCandHashTable::ComputeWorkCandHashIndex(const MeExpr &meExpr) { switch (meOp) { case kMeOpAddrof: case kMeOpAddroffunc: + case kMeOpAddroflabel: case kMeOpGcmalloc: case kMeOpConst: case kMeOpConststr: diff --git a/src/mapleall/maple_me/src/ssa_devirtual.cpp b/src/mapleall/maple_me/src/ssa_devirtual.cpp index 24237ed91f587f12d9833929d99df953486e1c0e..2046d7856aca35437bfdaf870c1d237d3c932d77 100755 --- a/src/mapleall/maple_me/src/ssa_devirtual.cpp +++ b/src/mapleall/maple_me/src/ssa_devirtual.cpp @@ -403,6 +403,7 @@ void SSADevirtual::VisitMeExpr(MeExpr *meExpr) const { } case kMeOpAddrof: case kMeOpAddroffunc: + case kMeOpAddroflabel: case kMeOpGcmalloc: case kMeOpConst: case kMeOpConststr: @@ -476,6 +477,7 @@ void SSADevirtual::TraversalMeStmt(MeStmt &meStmt) { } case OP_assertnonnull: case OP_eval: + case OP_igoto: case OP_free: { auto *unaryStmt = static_cast(&meStmt); VisitMeExpr(unaryStmt->GetOpnd()); diff --git a/src/mapleall/maple_me/src/ssa_epre.cpp b/src/mapleall/maple_me/src/ssa_epre.cpp index ca895efa6a7d0617b9b1e836f01feba3049f9b70..e74d01da5756020b7acd0a9fd6f2d3643a251d4b 100755 --- a/src/mapleall/maple_me/src/ssa_epre.cpp +++ b/src/mapleall/maple_me/src/ssa_epre.cpp @@ -377,6 +377,7 @@ void SSAEPre::BuildWorkListExpr(MeStmt &meStmt, int32 seqStmt, MeExpr &meExpr, b case kMeOpReg: case kMeOpAddrof: case kMeOpAddroffunc: + case kMeOpAddroflabel: case kMeOpGcmalloc: case kMeOpConst: case kMeOpConststr: diff --git a/src/mapleall/maple_me/src/ssa_pre.cpp b/src/mapleall/maple_me/src/ssa_pre.cpp index 5ba5d4a9fe205f287bef27192c851ecaf0d98af8..6d5d57d382b583687f2603e28ff07a1dfc1f5535 100755 --- a/src/mapleall/maple_me/src/ssa_pre.cpp +++ b/src/mapleall/maple_me/src/ssa_pre.cpp @@ -1455,6 +1455,7 @@ void SSAPre::BuildWorkListStmt(MeStmt &stmt, uint32 seqStmt, bool isRebuilt, MeE case OP_incref: case OP_decrefreset: case OP_eval: + case OP_igoto: case OP_assertnonnull: case OP_free: { auto *unaryStmt = static_cast(meStmt); diff --git a/src/mapleall/mpl2mpl/src/constantfold.cpp b/src/mapleall/mpl2mpl/src/constantfold.cpp index b7c21d68e94e59782fbaba8db2b22cbd42962ec2..a2c225740e7a92fbd22cc45b8f5f86cddd03395e 100644 --- a/src/mapleall/mpl2mpl/src/constantfold.cpp +++ b/src/mapleall/mpl2mpl/src/constantfold.cpp @@ -119,6 +119,7 @@ StmtNode *ConstantFold::Simplify(StmtNode *node) { case OP_decrefreset: case OP_regassign: case OP_assertnonnull: + case OP_igoto: return SimplifyUnary(static_cast(node)); case OP_assertge: case OP_assertlt: