Skip to content

Commit

Permalink
Merge pull request #16155 from hzongaro/prevent-compact-locals-with-p…
Browse files Browse the repository at this point in the history
…rofiling

Use profilingOpts strategy under JitProfiling mode only
  • Loading branch information
vijaysun-omr committed Nov 15, 2022
2 parents 32103d3 + 86f0c00 commit 30a8df1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
25 changes: 15 additions & 10 deletions runtime/compiler/optimizer/J9Optimizer.cpp
Expand Up @@ -295,7 +295,7 @@ static const OptimizationStrategy coldStrategyOpts[] =
{ OMR::jProfilingValue, OMR::MustBeDone },
{ OMR::treeLowering, OMR::MustBeDone },
{ OMR::globalLiveVariablesForGC, OMR::IfAggressiveLiveness },
{ OMR::profilingGroup, OMR::IfProfiling },
{ OMR::jitProfilingGroup, OMR::IfJitProfiling },
{ OMR::regDepCopyRemoval },
{ OMR::hotFieldMarking },
{ OMR::endOpts }
Expand Down Expand Up @@ -392,9 +392,9 @@ static const OptimizationStrategy warmStrategyOpts[] =
{ OMR::compactNullChecks, OMR::IfEnabled }, // cleanup at the end
{ OMR::deadTreesElimination, OMR::IfEnabled }, // remove dead anchors created by check/store removal
{ OMR::deadTreesElimination, OMR::IfEnabled }, // remove dead RegStores produced by previous deadTrees pass
{ OMR::compactLocals, OMR::IfNotJitProfiling }, // analysis results are invalidated by profilingGroup
{ OMR::compactLocals, OMR::IfNotJitProfiling }, // analysis results are invalidated by jitProfilingGroup
{ OMR::globalLiveVariablesForGC },
{ OMR::profilingGroup, OMR::IfProfiling },
{ OMR::jitProfilingGroup, OMR::IfJitProfiling },
{ OMR::regDepCopyRemoval },
{ OMR::hotFieldMarking },
{ OMR::endOpts }
Expand Down Expand Up @@ -509,7 +509,7 @@ const OptimizationStrategy hotStrategyOpts[] =
{ OMR::deadTreesElimination }, // cleanup after dead store removal
{ OMR::compactNullChecks }, // cleanup at the end
{ OMR::finalGlobalGroup }, // done just before codegen
{ OMR::profilingGroup, OMR::IfProfiling },
{ OMR::jitProfilingGroup, OMR::IfJitProfiling },
{ OMR::regDepCopyRemoval },
{ OMR::hotFieldMarking },
{ OMR::endOpts }
Expand Down Expand Up @@ -600,7 +600,7 @@ const OptimizationStrategy scorchingStrategyOpts[] =
{ OMR::deadTreesElimination }, // cleanup after dead store removal
{ OMR::compactNullChecks }, // cleanup at the end
{ OMR::finalGlobalGroup }, // done just before codegen
{ OMR::profilingGroup, OMR::IfProfiling },
{ OMR::jitProfilingGroup, OMR::IfJitProfiling },
{ OMR::regDepCopyRemoval },
{ OMR::hotFieldMarking },
{ OMR::endOpts }
Expand Down Expand Up @@ -785,16 +785,21 @@ static const OptimizationStrategy cheapWarmStrategyOpts[] =
{ OMR::deadTreesElimination, OMR::IfEnabled }, // remove dead anchors created by check/store removal
{ OMR::deadTreesElimination, OMR::IfEnabled }, // remove dead RegStores produced by previous deadTrees pass
{ OMR::redundantGotoElimination, OMR::IfEnabledAndNotJitProfiling }, // dead store and dead tree elimination may have left empty blocks
{ OMR::compactLocals, OMR::IfNotJitProfiling }, // analysis results are invalidated by profilingGroup
{ OMR::compactLocals, OMR::IfNotJitProfiling }, // analysis results are invalidated by jitProfilingGroup
{ OMR::globalLiveVariablesForGC },
{ OMR::profilingGroup, OMR::IfProfiling },
{ OMR::jitProfilingGroup, OMR::IfJitProfiling },
{ OMR::regDepCopyRemoval },
{ OMR::hotFieldMarking },
{ OMR::endOpts }
};


static const OptimizationStrategy profilingOpts[] =
// **********************************************************
//
// Transformations that are specific to JitProfiling mode
//
// **********************************************************
static const OptimizationStrategy jitProfilingOpts[] =
{
{ OMR::profileGenerator, OMR::MustBeDone },
{ OMR::deadTreesElimination, OMR::IfEnabled },
Expand Down Expand Up @@ -928,8 +933,8 @@ J9::Optimizer::Optimizer(TR::Compilation *comp, TR::ResolvedMethodSymbol *method
new (comp->allocator()) TR::OptimizationManager(self(), NULL, OMR::signExtendLoadsGroup, signExtendLoadsOpts);
_opts[OMR::loopSpecializerGroup] =
new (comp->allocator()) TR::OptimizationManager(self(), NULL, OMR::loopSpecializerGroup, loopSpecializerOpts);
_opts[OMR::profilingGroup] =
new (comp->allocator()) TR::OptimizationManager(self(), NULL, OMR::profilingGroup, profilingOpts);
_opts[OMR::jitProfilingGroup] =
new (comp->allocator()) TR::OptimizationManager(self(), NULL, OMR::jitProfilingGroup, jitProfilingOpts);
_opts[OMR::sequentialLoadAndStoreColdGroup] =
new (comp->allocator()) TR::OptimizationManager(self(), NULL, OMR::sequentialLoadAndStoreColdGroup, sequentialLoadAndStoreColdOpts);
_opts[OMR::sequentialLoadAndStoreWarmGroup] =
Expand Down
4 changes: 2 additions & 2 deletions runtime/compiler/optimizer/OptimizationGroups.enum
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2019 IBM Corp. and others
* Copyright (c) 2000, 2022 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -27,7 +27,7 @@

#include "optimizer/OMROptimizationGroups.enum"

OPTIMIZATION(profilingGroup)
OPTIMIZATION(jitProfilingGroup)

OPTIMIZATION(noOptStrategy)
OPTIMIZATION(coldStrategy)
Expand Down

0 comments on commit 30a8df1

Please sign in to comment.