Skip to content

Commit

Permalink
Simplify child index calculation code in PRE
Browse files Browse the repository at this point in the history
The child index of rhsNode of a store is more relevant to whether the
store is indirect or direct rather than whether it's a wrtbar. Simplify
the calculation to make it more clear.

Signed-off-by: Yi Zhang <yizhang@ca.ibm.com>
  • Loading branch information
Yi Zhang committed Nov 8, 2018
1 parent d5ac94e commit 28e8e6e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/optimizer/PartialRedundancy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3925,7 +3925,7 @@ bool TR_ExceptionCheckMotion::includeRelevantNodes(TR::Node *node, vcount_t visi

int32_t rhsChild = -1;
if (node->getOpCode().isStore())
rhsChild = (node->getNumChildren() - ((node->getOpCode().isWrtBar()) ? 2 : 1));
rhsChild = node->getOpCode().isStoreDirect() ? 0 : 1;

bool childRelevant = false, containsIndirectAccess = false, containsArrayAccess = false, containsDivide = false, containsUnresolvedAccess = false;
int32_t i;
Expand Down

0 comments on commit 28e8e6e

Please sign in to comment.