diff --git a/src/bin/maple b/src/bin/maple index ed53b9672d2f3eafcd08ee10f70646a1a4e08eaa..3c4417ecf864552484363d2cb4abf0de98045d9e 100755 Binary files a/src/bin/maple and b/src/bin/maple differ diff --git a/src/bin/mplcg b/src/bin/mplcg index e5195020daf85b8a2e8f2456625a71feed7d66b3..de252c51c1e310618d3fecf7474cb885cca26b72 100755 Binary files a/src/bin/mplcg and b/src/bin/mplcg differ diff --git a/src/maple_ir/include/opcodes.h b/src/maple_ir/include/opcodes.h index fea500ac604b8ba3c1f2b8121250d3e992a825e1..6af2017ca4c6e3f13b5fc944cc66737241285912 100644 --- a/src/maple_ir/include/opcodes.h +++ b/src/maple_ir/include/opcodes.h @@ -39,15 +39,7 @@ inline constexpr bool IsCallAssigned(Opcode code) { } inline constexpr bool IsBranch(Opcode opcode) { - switch (opcode) { - case OP_goto: - case OP_brtrue: - case OP_brfalse: - case OP_switch: - return true; - default: - return false; - } + return (opcode == OP_goto || opcode == OP_brtrue || opcode == OP_brfalse || opcode == OP_switch); } constexpr bool IsStmtMustRequire(Opcode opcode) { diff --git a/src/maple_me/include/bb.h b/src/maple_me/include/bb.h index 03343360b68a294f43abfb85037344d2bc59cad9..ab10431631a9b7c9413bd5f60f8d68c2fc57e880 100644 --- a/src/maple_me/include/bb.h +++ b/src/maple_me/include/bb.h @@ -423,20 +423,6 @@ class SCCOfBBs { MapleSet predSCC; MapleSet succSCC; }; - -inline bool ControlFlowInInfiniteLoop(const BB& bb, Opcode opcode) { - switch (opcode) { - // goto always return true - case OP_goto: - return true; - case OP_brtrue: - case OP_brfalse: - case OP_switch: - return bb.GetAttributes(kBBAttrWontExit); - default: - return false; - } -} } // namespace maple namespace std { diff --git a/src/maple_me/include/me_ir.h b/src/maple_me/include/me_ir.h index 7a564f7469b2d80f568900d0ee8f260a605059d2..a1b4e87ddf9bb524193b6f07cca58c1128ca879d 100644 --- a/src/maple_me/include/me_ir.h +++ b/src/maple_me/include/me_ir.h @@ -129,7 +129,7 @@ class MeExpr { return op == OP_gcmalloc || op == OP_gcmallocjarray || op == OP_gcpermalloc || op == OP_gcpermallocjarray; } - virtual bool IsVolatile(const SSATab&) { + virtual bool IsVolatile(const SSATab&) const { return false; } @@ -217,7 +217,7 @@ class VarMeExpr final : public MeExpr { } BB *DefByBB(); - bool IsVolatile(const SSATab&) override; + bool IsVolatile(const SSATab&) const override; // indicate if the variable is local variable but not a function formal variable bool IsPureLocal(const SSATab&, const MIRFunction&) const; bool IsZeroVersion(const SSATab&) const; @@ -500,6 +500,10 @@ class RegMeExpr : public MeExpr { def.defMustDef = &defMustDefVal; } + bool IsNormalReg() const { + return regIdx >= 0; + } + private: union { MeStmt *defStmt = nullptr; @@ -923,7 +927,7 @@ class IvarMeExpr : public MeExpr { void Dump(IRMap*, int32 indent = 0) const override; BaseNode &EmitExpr(SSATab&) override; - bool IsVolatile(const SSATab&) override { + bool IsVolatile(const SSATab&) const override { return IsVolatile(); } @@ -993,7 +997,9 @@ class IvarMeExpr : public MeExpr { VarMeExpr *GetMu() { return mu; } - + const VarMeExpr *GetMu() const { + return mu; + } void SetMuVal(VarMeExpr *muVal) { mu = muVal; } diff --git a/src/maple_me/src/alias_class.cpp b/src/maple_me/src/alias_class.cpp index dcc2448032d930109d334b12b7f43fbfc91f68c5..d97ef4c24ca812445bcdc13a03e2f3dc9e200f32 100644 --- a/src/maple_me/src/alias_class.cpp +++ b/src/maple_me/src/alias_class.cpp @@ -124,7 +124,7 @@ AliasElem *AliasClass::CreateAliasElemsExpr(BaseNode &expr) { } case OP_iread: { auto &iread = static_cast(expr); - return FindOrCreateExtraLevAliasElem(*iread.Opnd(0), iread.GetTyIdx(), iread.GetFieldID()); + return FindOrCreateExtraLevAliasElem(utils::ToRef(iread.Opnd(0)), iread.GetTyIdx(), iread.GetFieldID()); } case OP_iaddrof: { auto &iread = static_cast(expr); diff --git a/src/maple_me/src/me_ir.cpp b/src/maple_me/src/me_ir.cpp index a6fc90530650981594e18191d27156a785b48bd4..e7aec5d7893adfbfbb3c8e3cbf2e69141ee31739 100644 --- a/src/maple_me/src/me_ir.cpp +++ b/src/maple_me/src/me_ir.cpp @@ -1270,7 +1270,7 @@ BB *VarMeExpr::DefByBB() { } } -bool VarMeExpr::IsVolatile(const SSATab &ssatab) { +bool VarMeExpr::IsVolatile(const SSATab &ssatab) const { const OriginalSt *ost = ssatab.GetOriginalStFromID(ostIdx); if (!ost->IsSymbolOst()) { return false;