Skip to content

Commit

Permalink
Merge pull request #16206 from r30shah/disableMergingIfHasVectorAPI
Browse files Browse the repository at this point in the history
Set VirtualGuard do not kill fear if has VectorAPIMethod
  • Loading branch information
jdmpapin authored Oct 28, 2022
2 parents 63668ec + b11a523 commit 71f768a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions runtime/compiler/optimizer/FearPointAnalysis.cpp
Original file line number Diff line number Diff line change
@@ -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 @@ -34,10 +34,10 @@
#include "infra/BitVector.hpp"
#include "infra/Checklist.hpp"

bool TR_FearPointAnalysis::virtualGuardsKillFear()
bool TR_FearPointAnalysis::virtualGuardsKillFear(TR::Compilation *comp)
{
static bool kill = (feGetEnv("TR_FPAnalaysisGuardsDoNotKillFear") == NULL);
return kill;
return kill && !(!comp->getOption(TR_DisableVectorAPIExpansion) && comp->getMethodSymbol()->hasVectorAPI());
}

int32_t TR_FearPointAnalysis::getNumberOfBits() { return 1; }
Expand Down Expand Up @@ -246,7 +246,7 @@ void TR_FearPointAnalysis::initializeGenAndKillSetInfo()
}

// kill any fear originating from inside
if (virtualGuardsKillFear()
if (virtualGuardsKillFear(comp())
&& treeTop->getNode()->isTheVirtualGuardForAGuardedInlinedCall()
&& comp()->cg()->supportsMergingGuards())
{
Expand Down
4 changes: 2 additions & 2 deletions runtime/compiler/optimizer/FearPointAnalysis.hpp
Original file line number Diff line number Diff line change
@@ -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 @@ -41,7 +41,7 @@ class TR_FearPointAnalysis : public TR_BackwardUnionSingleBitContainerAnalysis
virtual bool postInitializationProcessing();
TR_SingleBitContainer *generatedFear(TR::Node *node);

static bool virtualGuardsKillFear();
static bool virtualGuardsKillFear(TR::Compilation *comp);

private:
void computeFear(TR::Compilation *comp, TR::Node *node, TR::NodeChecklist &checklist);
Expand Down
4 changes: 2 additions & 2 deletions runtime/compiler/optimizer/HCRGuardAnalysis.cpp
Original file line number Diff line number Diff line change
@@ -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 @@ -191,7 +191,7 @@ void TR_HCRGuardAnalysis::initializeGenAndKillSetInfo()
}
}
else if (ttNode->isTheVirtualGuardForAGuardedInlinedCall()
&& TR_FearPointAnalysis::virtualGuardsKillFear()
&& TR_FearPointAnalysis::virtualGuardsKillFear(comp())
&& comp()->cg()->supportsMergingGuards())
{
TR_VirtualGuard *guardInfo = comp()->findVirtualGuardInfo(ttNode);
Expand Down
6 changes: 3 additions & 3 deletions runtime/compiler/optimizer/OSRGuardInsertion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ void TR_OSRGuardInsertion::removeHCRGuards(TR_BitVector &fearGeneratingNodes, TR

// if virtual guards kill fear we can short cut additional analysis if the method still has a guard
// we can mark that guard as an OSR guard and continue without needing a data flow analysis
if (TR_FearPointAnalysis::virtualGuardsKillFear()
if (TR_FearPointAnalysis::virtualGuardsKillFear(comp())
&& additionalVirtualGuard
&& comp()->cg()->supportsMergingGuards())
{
Expand All @@ -412,7 +412,7 @@ void TR_OSRGuardInsertion::removeHCRGuards(TR_BitVector &fearGeneratingNodes, TR
{
comp()->addClassForOSRRedefinition(guardInfo->getThisClass());
guardInfo->setMergedWithHCRGuard(false);
if (TR_FearPointAnalysis::virtualGuardsKillFear())
if (TR_FearPointAnalysis::virtualGuardsKillFear(comp()))
guardInfo->setMergedWithOSRGuard();
else
{
Expand Down Expand Up @@ -475,7 +475,7 @@ int32_t TR_OSRGuardInsertion::insertOSRGuards(TR_BitVector &fearGeneratingNodes)
continue;
}

if (TR_FearPointAnalysis::virtualGuardsKillFear()
if (TR_FearPointAnalysis::virtualGuardsKillFear(comp())
&& cursor->getNode()->isTheVirtualGuardForAGuardedInlinedCall()
&& comp()->cg()->supportsMergingGuards())
{
Expand Down

0 comments on commit 71f768a

Please sign in to comment.