From 96d715a0a8ca1ab5ab085761d023122df4b9398f Mon Sep 17 00:00:00 2001 From: Fred Chow Date: Wed, 28 Apr 2021 12:59:43 -0700 Subject: [PATCH] Do not apply LPRE to lhs occurrence of bitfields --- src/mapleall/maple_me/src/me_ssa_lpre.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/mapleall/maple_me/src/me_ssa_lpre.cpp b/src/mapleall/maple_me/src/me_ssa_lpre.cpp index d5dea07fa9..78dfdf9abc 100644 --- a/src/mapleall/maple_me/src/me_ssa_lpre.cpp +++ b/src/mapleall/maple_me/src/me_ssa_lpre.cpp @@ -183,6 +183,12 @@ void MeSSALPre::BuildWorkListLHSOcc(MeStmt &meStmt, int32 seqStmt) { VarMeExpr *lhs = meStmt.GetVarLHS(); CHECK_NULL_FATAL(lhs); const OriginalSt *ost = lhs->GetOst(); + if (mirModule->IsCModule()) { + MIRType *ty = GlobalTables::GetTypeTable().GetTypeFromTyIdx(ost->GetTyIdx()); + if (ty->GetKind() == kTypeBitField || ty->GetSize() < 4) { + return; // no advantage + } + } if (ost->IsFormal()) { (void)assignedFormals.insert(ost->GetIndex()); } -- Gitee