Skip to content

Commit

Permalink
Merge pull request #18312 from klangman/fix-currentTimeMillis-Simplifier
Browse files Browse the repository at this point in the history
Fix Tree Simplifier convertCurrentTimeMillis()
  • Loading branch information
vijaysun-omr committed Oct 27, 2023
2 parents 601957a + 28068f4 commit 869824b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion runtime/compiler/optimizer/J9Simplifier.cpp
Expand Up @@ -362,9 +362,11 @@ J9::Simplifier::simplifylCallMethods(TR::Node * node, TR::Block * block)
//
// to:
//
// <new tree>
// lcall currentTimeMaxPrecision
// <tree>
// ldiv
// lcall currentTimeMaxPrecision
// ==>lcall currentTimeMaxPrecision
// lconst <divisor value>
TR::Node *J9::Simplifier::convertCurrentTimeMillis(TR::Node * node, TR::Block * block)
{
Expand All @@ -386,6 +388,7 @@ TR::Node *J9::Simplifier::convertCurrentTimeMillis(TR::Node * node, TR::Block *
divConstNode->setLongInt(OMRPORT_TIME_HIRES_MILLITIME_DIVISOR);

TR::Node::recreate(node, TR::ldiv);
callTreeTop->insertBefore(TR::TreeTop::create(comp(), TR::Node::create(node, TR::treetop, 1, lcallNode)));
node->setNumChildren(2);
node->setAndIncChild(0, lcallNode);

Expand Down

0 comments on commit 869824b

Please sign in to comment.