From 2d8599f4cda6b61b61d57d40e12a5eed18e81300 Mon Sep 17 00:00:00 2001 From: William Chen Date: Tue, 23 Nov 2021 17:01:20 -0800 Subject: [PATCH] globalopt not back propagate across mem opnd with indexed mode Also turn on loop checking. --- src/mapleall/maple_be/src/cg/aarch64/aarch64_global.cpp | 4 ++++ src/mapleall/maple_be/src/cg/loop.cpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) 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 ce4b867b75..87d94c65e7 100644 --- a/src/mapleall/maple_be/src/cg/aarch64/aarch64_global.cpp +++ b/src/mapleall/maple_be/src/cg/aarch64/aarch64_global.cpp @@ -553,6 +553,10 @@ bool BackPropPattern::CheckReplacedUseInsn(Insn &insn) { return true; }; /* ensure that the use insns to be replaced is defined by defInsnForSecondOpnd only */ + if (useInsn->IsMemAccess() && + static_cast(static_cast(useInsn)->GetMemOpnd())->GetIndexOpt() != AArch64MemOperand::kIntact) { + return false; + } InsnSet defInsnVecOfSrcOpnd = cgFunc.GetRD()->FindDefForRegOpnd(*useInsn, secondRegNO, true); if (!checkOneDefOnly(defInsnVecOfSrcOpnd, *defInsnForSecondOpnd, true)) { return false; diff --git a/src/mapleall/maple_be/src/cg/loop.cpp b/src/mapleall/maple_be/src/cg/loop.cpp index 9253f7b1e6..c581108110 100644 --- a/src/mapleall/maple_be/src/cg/loop.cpp +++ b/src/mapleall/maple_be/src/cg/loop.cpp @@ -657,7 +657,7 @@ bool CgLoopAnalysis::PhaseRun(maplebe::CGFunc &f) { /* do dot gen after detection so the loop backedge can be properly colored using the loop info */ DotGenerator::GenerateDot("buildloop", f, f.GetMirModule(), true, f.GetName()); } -#if xDEBUG +#if DEBUG for (const auto *lp : f.GetLoops()) { lp->CheckLoops(); } -- Gitee