Skip to content

Commit af5aa2c

Browse files
authored
Merge pull request #21542 from vijaysun-omr/staticpics1
Change X86 static IPIC heuristics
2 parents fba2247 + d352bcd commit af5aa2c

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

runtime/compiler/x/codegen/X86PrivateLinkage.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1473,7 +1473,11 @@ void TR::X86CallSite::computeProfiledTargets()
14731473
(!profiledInterfaceMethod->isInterpreted() ||
14741474
profiledInterfaceMethod->isJITInternalNative()))
14751475
{
1476-
if (frequency < getMinProfiledCallFrequency())
1476+
float minProfiledCallFrequency = getMinProfiledCallFrequency();
1477+
if (comp()->getMethodHotness() > warm)
1478+
minProfiledCallFrequency = 0.0f;
1479+
1480+
if (frequency < minProfiledCallFrequency)
14771481
{
14781482
if (comp()->getOption(TR_TraceCG))
14791483
traceMsg(comp(), " - Too infrequent");
@@ -1508,7 +1512,10 @@ void TR::X86CallSite::computeProfiledTargets()
15081512

15091513
_useLastITableCache = !comp()->getOption(TR_DisableLastITableCache) ? true : false;
15101514
// Disable lastITable logic if all the implementers can fit into the pic slots during non-startup state
1511-
if (_useLastITableCache && comp()->target().is64Bit() && _interfaceClassOfMethod && comp()->getPersistentInfo()->getJitState() != STARTUP_STATE)
1515+
// Since instruction cache pressure is not very significant at higher opt levels, and new classes could be loaded in the future.
1516+
// So, keep this opt enabled at higher opt levels to save path length.
1517+
//
1518+
if (_useLastITableCache && comp()->target().is64Bit() && (comp()->getMethodHotness() <= warm) && _interfaceClassOfMethod && comp()->getPersistentInfo()->getJitState() != STARTUP_STATE)
15121519
{
15131520
J9::X86::PrivateLinkage *privateLinkage = static_cast<J9::X86::PrivateLinkage *>(getLinkage());
15141521
int32_t numPICSlots = numStaticPICSlots + privateLinkage->IPicParameters.defaultNumberOfSlots;

runtime/compiler/x/codegen/X86PrivateLinkage.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ class X86CallSite
171171
uint8_t *getThunkAddress() {return _thunkAddress;}
172172
void setThunkAddress(uint8_t *t) {_thunkAddress = t;}
173173

174-
float getMinProfiledCallFrequency(){ return .075F; } // Tuned for megamorphic site in jess; so bear in mind before changing
174+
float getMinProfiledCallFrequency(){ return .025F; }
175175

176176
public:
177177

0 commit comments

Comments
 (0)