Skip to content

Commit

Permalink
Merge pull request #6662 from jdmpapin/vp-perform-xform
Browse files Browse the repository at this point in the history
Use performTransformation() for VP VFT load folding
  • Loading branch information
0xdaryl committed Aug 18, 2022
2 parents dda2d2e + fbeeeca commit 469905b
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions compiler/optimizer/VPHandlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,19 @@ static bool tryFoldCompileTimeLoad(
if (vp->comp()->compileRelocatableCode() && !vp->comp()->getOption(TR_UseSymbolValidationManager) && (vp->comp()->target().cpu.isPower() || fej9->getClassLoader(clazz) != fej9->getSystemClassLoader()))
return false;
#endif
if (vp->trace())
traceMsg(vp->comp(), "VP Transforming VFTLoad to loadaddr: as n%dn is VFT load of known class", node->getGlobalIndex());
// performTransformation() is needed here but not in the other cases
// because transformIndirectLoadChain[At]() does one internally.
if (!performTransformation(
vp->comp(),
"%sTransforming VFT load n%un [%p] to loadaddr "
"based on the fixed type of n%un [%p]\n",
OPT_DETAILS,
node->getGlobalIndex(),
node,
curNode->getGlobalIndex(),
curNode))
return false;

node->setNumChildren(0);
TR::Node::recreateWithSymRef(node, TR::loadaddr, vp->comp()->getSymRefTab()->findOrCreateClassSymbol(vp->comp()->getMethodSymbol(), -1, clazz));
node->setFlags(0);
Expand Down

0 comments on commit 469905b

Please sign in to comment.