From d7269e20c595ca79503b305a93d66b3dcf31b6f6 Mon Sep 17 00:00:00 2001 From: Fred Chow Date: Wed, 7 Jul 2021 20:30:03 -0700 Subject: [PATCH] In determining SRcand, check in-loop condition for all occurrences (not just the first one) --- src/mapleall/maple_me/src/ssa_pre.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mapleall/maple_me/src/ssa_pre.cpp b/src/mapleall/maple_me/src/ssa_pre.cpp index 781294ac7f..aaec18c1e4 100644 --- a/src/mapleall/maple_me/src/ssa_pre.cpp +++ b/src/mapleall/maple_me/src/ssa_pre.cpp @@ -1407,6 +1407,9 @@ void SSAPre::CreateRealOcc(MeStmt &meStmt, int seqStmt, MeExpr &meExpr, bool ins } else { wkCand->AddRealOccAsLast(*newOcc, GetPUIdx()); } + if (strengthReduction && !wkCand->isSRCand && meExpr.StrengthReducible() && meStmt.GetBB()->GetAttributes(kBBAttrIsInLoop)) { + wkCand->isSRCand = true; + } return; } // workcand not yet created; create a new one and add to worklist -- Gitee