From ce568f5ec8de5c85c3ece55ea85246dd50452444 Mon Sep 17 00:00:00 2001 From: William Chen Date: Mon, 22 Aug 2022 08:38:24 -0700 Subject: [PATCH] Ebo check liveout when trying to remove move of same reg --- src/mapleall/maple_be/src/cg/ebo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mapleall/maple_be/src/cg/ebo.cpp b/src/mapleall/maple_be/src/cg/ebo.cpp index 6c14a630af..258808e83b 100644 --- a/src/mapleall/maple_be/src/cg/ebo.cpp +++ b/src/mapleall/maple_be/src/cg/ebo.cpp @@ -606,7 +606,7 @@ bool Ebo::ForwardPropagateOpnd(Insn &insn, Operand *&opnd, uint32 opndIndex, } /* Copies to and from the same register are not needed. */ if (!beforeRegAlloc && Globals::GetInstance()->GetTarget()->IsEffectiveCopy(insn) && (opndIndex == kInsnSecondOpnd) && - RegistersIdentical(*opnd, insn.GetOperand(kInsnFirstOpnd))) { + RegistersIdentical(*opnd, insn.GetOperand(kInsnFirstOpnd)) && !LiveOutOfBB(*opnd, *(insn.GetBB()))) { if (EBO_DUMP) { LogInfo::MapleLogger() << "===replace operand " << opndIndex << " of insn: \n"; insn.Dump(); -- Gitee