Skip to content

Commit

Permalink
Remove support for multiple children for imaxminSimplifier
Browse files Browse the repository at this point in the history
Replace 'num_children' with '2' in 'imaxminSimplifier()'
Fixes eclipse-omr#4176

Signed-off-by: Aidan Ha <qbha@edu.uwaterloo.ca>
  • Loading branch information
AidanHa committed Sep 4, 2019
1 parent 14248fb commit cdec2b9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions compiler/optimizer/OMRSimplifierHandlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16947,7 +16947,6 @@ TR::Node *imaxminSimplifier(TR::Node * node, TR::Block * block, TR::Simplifier *
simplifyChildren(node, block, s);

int32_t i = 0;
int32_t num_children = node->getNumChildren();
int32_t min = 0, max = 0;
uint32_t umin = 0, umax = 0;
bool is_all_const = true;
Expand All @@ -16957,7 +16956,7 @@ TR::Node *imaxminSimplifier(TR::Node * node, TR::Block * block, TR::Simplifier *
bool max_opcode = node->getOpCodeValue() == TR::imax || node->getOpCodeValue() == TR::iumax;
TR::Node * constNode = NULL;

for (i = 0; i < num_children; i++)
for (i = 0; i < 2; i++)
{
if (is_signed && node->getChild(i)->getOpCode().isLoadConst())
{
Expand All @@ -16977,7 +16976,7 @@ TR::Node *imaxminSimplifier(TR::Node * node, TR::Block * block, TR::Simplifier *

if (has_const)
{
for (i = 0; i < num_children; i++)
for (i = 0; i < 2; i++)
{
if (is_signed && node->getChild(i)->getOpCode().isLoadConst())
{
Expand Down

0 comments on commit cdec2b9

Please sign in to comment.