Skip to content

Commit

Permalink
Merge pull request #3603 from liqunl/fsd
Browse files Browse the repository at this point in the history
Run OSR live range analysis and OSR def analysis first
  • Loading branch information
vijaysun-omr authored Feb 26, 2019
2 parents e6c6285 + 8cee296 commit 53fdb04
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
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

0 comments on commit 53fdb04

Please sign in to comment.