Skip to content

Commit c92a4ae

Browse files
jgu222igcbot
authored andcommitted
_Don't run mergestore if store combining is on
Store combining is a super set of mergestore. If store combining is on, do not run mergestore as it is not needed. Don't expect functional change.
1 parent 4b0eebb commit c92a4ae

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

IGC/Compiler/CISACodeGen/MemOpt.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,9 @@ bool MemOpt::runOnFunction(Function& F) {
520520
if (ProfitVectorLengths.empty())
521521
buildProfitVectorLengths(F);
522522

523+
// If LdStCombining is on, no need to do memopt.
524+
const bool LdStCombineOn = doLdStCombine(CGC);
525+
523526
bool Changed = false;
524527

525528
IGC::IGCMD::FunctionInfoMetaDataHandle funcInfoMD = MDU->getFunctionsInfoItem(&F);
@@ -568,8 +571,10 @@ bool MemOpt::runOnFunction(Function& F) {
568571

569572
if (LoadInst * LI = dyn_cast<LoadInst>(I))
570573
Changed |= mergeLoad(LI, MI, MemRefs, MemRefsToOptimize);
571-
else if (StoreInst * SI = dyn_cast<StoreInst>(I))
572-
Changed |= mergeStore(SI, MI, MemRefs, MemRefsToOptimize);
574+
else if (StoreInst* SI = dyn_cast<StoreInst>(I)) {
575+
if (!LdStCombineOn)
576+
Changed |= mergeStore(SI, MI, MemRefs, MemRefsToOptimize);
577+
}
573578
else if (EnableRemoveRedBlockreads) {
574579
if (GenIntrinsicInst* GInst = dyn_cast<GenIntrinsicInst>(I)) {
575580
if (GInst->getIntrinsicID() == GenISAIntrinsic::GenISA_simdBlockRead) {

0 commit comments

Comments
 (0)