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 0bbee8d65fd32aa765d65f635672cf5ca2d93115..2b4a7bd1096a302e4ab6fa8347002f76ed9e5424 100644 --- a/src/mapleall/maple_be/src/cg/aarch64/aarch64_cgfunc.cpp +++ b/src/mapleall/maple_be/src/cg/aarch64/aarch64_cgfunc.cpp @@ -6424,7 +6424,8 @@ AArch64RegOperand *AArch64CGFunc::SelectParmListDreadAccessField(const MIRSymbol memOpnd = &GetOrCreateMemOpnd(sym, (kSizeOfPtr * parmNum + offset), memSize); } MOperator selectedMop = PickLdInsn(dataSizeBits, primType); - if (!IsOperandImmValid(selectedMop, memOpnd, kInsnSecondOpnd)) { + if ((static_cast(memOpnd)->GetAddrMode() == AArch64MemOperand::kAddrModeBOi) && + !IsOperandImmValid(selectedMop, memOpnd, kInsnSecondOpnd)) { memOpnd = &SplitOffsetWithAddInstruction(*static_cast(memOpnd), dataSizeBits); } GetCurBB()->AppendInsn(cg->BuildInstruction(selectedMop, *parmOpnd, *memOpnd)); diff --git a/src/mapleall/maple_be/src/cg/aarch64/aarch64_global.cpp b/src/mapleall/maple_be/src/cg/aarch64/aarch64_global.cpp index 32fec5d9d145598f9e5c3836cc27062328d265c4..2f92e14ab882b71970c6e1cf998af8d2eea342bd 100644 --- a/src/mapleall/maple_be/src/cg/aarch64/aarch64_global.cpp +++ b/src/mapleall/maple_be/src/cg/aarch64/aarch64_global.cpp @@ -96,7 +96,9 @@ bool OptimizePattern::OpndDefByOneOrZero(Insn &insn, int32 useIdx) const { } InsnSet defInsnSet = cgFunc.GetRD()->FindDefForRegOpnd(insn, useIdx); - ASSERT(!defInsnSet.empty(), "Operand must be defined before used"); + if (defInsnSet.empty()) { + return false; + } for (auto &defInsn : defInsnSet) { if (!InsnDefOneOrZero(*defInsn)) { diff --git a/src/mapleall/maple_be/src/cg/aarch64/aarch64_reaching.cpp b/src/mapleall/maple_be/src/cg/aarch64/aarch64_reaching.cpp index 8a54d7fbd84e3324e80c15ae6aadcfb0fb5b934a..61a5d1628faa7c8b5f00a153dd0f1e175f980ce6 100644 --- a/src/mapleall/maple_be/src/cg/aarch64/aarch64_reaching.cpp +++ b/src/mapleall/maple_be/src/cg/aarch64/aarch64_reaching.cpp @@ -707,7 +707,6 @@ bool AArch64ReachingDefinition::FindRegUsingBetweenInsn(uint32 regNO, Insn *star } ASSERT(startInsn->GetBB() == endInsn->GetBB(), "two insns must be in a same BB"); - ASSERT(endInsn->GetId() >= startInsn->GetId(), "two insns must be in a same BB"); for (Insn *insn = startInsn; insn != nullptr && insn != endInsn->GetNext(); insn = insn->GetNext()) { if (!insn->IsMachineInstruction()) { continue;