Skip to content

Commit

Permalink
Decimal Format Peephole incorrectly detecting opportunity
Browse files Browse the repository at this point in the history
Decimal Format Peephole was not correctly verifying that the
child of the format() call is the direct result of the
BigDecimal.{double/float}Value() call allowing for some
operations to be removed.

Signed-off-by: Kevin Langman <langman@ca.ibm.com>
  • Loading branch information
klangman committed Jul 16, 2018
1 parent eeda7b4 commit 646125e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion runtime/compiler/optimizer/StringPeepholes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ TR::TreeTop *TR_StringPeepholes::detectFormatPattern(TR::TreeTop *tt, TR::TreeTo
SPH_DecimalFormatHelper_formatAsFloat;

TR::SymbolReference *callSymRef = findSymRefForOptMethod (bdMethod);
if (callSymRef && performTransformation(comp(), "%ssimplified number format pattern from node [%p] to [%p] \n", optDetailString(), firstTree->getNode(), tt->getNode()))
if (nextNode->getSecondChild() == node && callSymRef && performTransformation(comp(), "%ssimplified number format pattern from node [%p] to [%p] \n", optDetailString(), firstTree->getNode(), tt->getNode()))
{
TR::TreeTop *prevTree = firstTree->getPrevTreeTop();
TR::TreeTop *treeAfterLast = tt->getNextTreeTop();
Expand Down

0 comments on commit 646125e

Please sign in to comment.