Skip to content

Commit

Permalink
Add IfVectorAPI optimizer flag
Browse files Browse the repository at this point in the history
This flag will be needed to add extra passes to optimization
strategies required for VectorAPIExpansion
  • Loading branch information
gita-omr committed Jul 27, 2021
1 parent a085752 commit 79f2da9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions compiler/il/OMRMethodSymbol.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ class OMR_EXTENSIBLE MethodSymbol : public TR::Symbol
HasCheckCasts = 0x00000004,
HasInstanceOfs = 0x00000008,
HasBranches = 0x00000010,
HasVectorAPI = 0x00000020,
dummyLastFlag2
};

Expand Down
4 changes: 3 additions & 1 deletion compiler/il/OMRResolvedMethodSymbol.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,9 @@ class OMR_EXTENSIBLE ResolvedMethodSymbol : public TR::MethodSymbol
bool hasCheckcastsOrInstanceOfs() { return _methodFlags2.testAny(HasCheckCasts|HasInstanceOfs); }
bool hasBranches() { return _methodFlags2.testAny(HasBranches); }
void setHasBranches(bool b) { _methodFlags2.set(HasBranches, b); }

bool hasVectorAPI() { return _methodFlags2.testAny(HasVectorAPI); }
void setHasVectorAPI(bool b) { _methodFlags2.set(HasVectorAPI, b); }

int32_t getNumberOfBackEdges();

bool canDirectNativeCall() { return _properties.testAny(CanDirectNativeCall); }
Expand Down
6 changes: 6 additions & 0 deletions compiler/optimizer/OMROptimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1544,6 +1544,12 @@ int32_t OMR::Optimizer::performOptimization(const OptimizationStrategy *optimiza
}
break;
}
case IfVectorAPI:
{
if (comp()->getMethodSymbol()->hasVectorAPI()) // TODO: add disable option and check it here
doThisOptimization = true;
}
break;
case MarkLastRun:
doThisOptimization = true;
TR_ASSERT(optNum < OMR::numOpts ,"No current support for marking groups as last (optNum=%d,numOpt=%d\n",optNum,OMR::numOpts); //make sure we didn't mark groups
Expand Down
1 change: 1 addition & 0 deletions compiler/optimizer/OMROptimizer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ enum
IfEAOpportunitiesMarkLastRun,
IfEAOpportunitiesAndNotOptServer,
IfAggressiveLiveness,
IfVectorAPI, // JEP414: Extra analysis required to optimize Vector API
MarkLastRun
};

Expand Down

0 comments on commit 79f2da9

Please sign in to comment.