Skip to content

Commit

Permalink
Use performTransformation() for VP VFT load folding
Browse files Browse the repository at this point in the history
This is an optional transformation, and when it is performed, tracing
should dump trees after the pass even if there were no other
transformations.
  • Loading branch information
jdmpapin committed Aug 15, 2022
1 parent 4c52ff1 commit fbeeeca
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 fbeeeca

Please sign in to comment.