Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run OSR live range analysis and OSR def analysis first #3603

Merged
merged 1 commit into from
Feb 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions compiler/compile/OMRCompilation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,7 @@ OMR::Compilation::requiresAnalysisOSRPoint(TR::Node *node)
if (!self()->isPotentialOSRPoint(node, &osrNode))
{
TR_ASSERT(0, "requiresAnalysisOSRPoint should only be called on OSR points\n");
return false;
}

// Calls require an analysis and transition point as liveness may change across them
Expand Down
4 changes: 2 additions & 2 deletions compiler/optimizer/OMROptimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -538,14 +538,14 @@ const OptimizationStrategy finalGlobalOpts[] =
static const OptimizationStrategy ilgenStrategyOpts[] =
{
#ifdef J9_PROJECT_SPECIFIC
{ osrLiveRangeAnalysis, IfOSR },
{ osrDefAnalysis, IfInvoluntaryOSR },
{ varHandleTransformer, MustBeDone },
{ unsafeFastPath },
{ recognizedCallTransformer },
{ coldBlockMarker },
{ allocationSinking, IfNews },
{ invariantArgumentPreexistence, IfNotClassLoadPhaseAndNotProfiling }, // Should not run if a recompilation is possible
{ osrLiveRangeAnalysis, IfOSR },
{ osrDefAnalysis, IfInvoluntaryOSR },
#endif
{ endOpts },
};
Expand Down
7 changes: 5 additions & 2 deletions compiler/optimizer/OSRDefAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1403,6 +1403,8 @@ int32_t TR_OSRLiveRangeAnalysis::fullAnalysis(bool includeParms, bool containsPe
vcount_t visitCount = comp()->incVisitCount();
block = comp()->getStartBlock();
_visitedBCI->empty();
int32_t callerIndex = comp()->getCurrentInlinedSiteIndex();

while (block)
{
blockNum = block->getNumber();
Expand Down Expand Up @@ -1507,8 +1509,9 @@ int32_t TR_OSRLiveRangeAnalysis::fullAnalysis(bool includeParms, bool containsPe
&& (comp()->isOSRTransitionTarget(TR::preExecutionOSR) || comp()->requiresAnalysisOSRPoint(node)))
{
TR_ByteCodeInfo bcInfo = node->getByteCodeInfo();
TR_ASSERT_FATAL(bcInfo.getCallerIndex() == callerIndex, "Found node with invalid caller index");
TR_OSRPoint *osrPoint = comp()->getMethodSymbol()->findOSRPoint(bcInfo);
TR_ASSERT(osrPoint != NULL, "Cannot find a pre OSR point for node %p", node);
TR_ASSERT_FATAL(osrPoint != NULL, "Cannot find a pre OSR point for node %p", node);

buildOSRLiveRangeInfo(node, _liveVars, osrPoint, liveLocalIndexToSymRefNumberMap,
numBits, osrMethodData, containsPendingPushes);
Expand Down Expand Up @@ -1799,7 +1802,7 @@ void TR_OSRLiveRangeAnalysis::buildOSRLiveRangeInfo(TR::Node *node, TR_BitVector
*deadSymRefs |= *_workDeadSymRefs;
}

if (newlyAllocated && !deadSymRefs->isEmpty())
if (newlyAllocated && deadSymRefs && !deadSymRefs->isEmpty())
osrMethodData->addLiveRangeInfo(byteCodeIndex, deadSymRefs);
}

Expand Down