Skip to content

Commit

Permalink
AArch64: Fix i2l-lshl optimization
Browse files Browse the repository at this point in the history
This commit fixes an issue introduced by #6011.

The i2l-lshl optimization skips assigning a register to the i2l node.
When the i2l node has two or more references, the i2l node is evaluated
later again, and it leads to unexpected results.

Signed-off-by: KONNO Kazuhiro <konno@jp.ibm.com>
  • Loading branch information
knn-k committed May 21, 2021
1 parent 04224a7 commit 054ad1e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions compiler/aarch64/codegen/BinaryEvaluator.cpp
Expand Up @@ -773,6 +773,7 @@ OMR::ARM64::TreeEvaluator::ishlEvaluator(TR::Node *node, TR::CodeGenerator *cg)
TR::Node *secondChild = node->getSecondChild();
if (firstChild->getOpCodeValue() == TR::i2l &&
firstChild->getRegister() == NULL &&
firstChild->getReferenceCount() == 1 &&
secondChild->getOpCodeValue() == TR::iconst &&
secondChild->getInt() < 32)
{
Expand Down

0 comments on commit 054ad1e

Please sign in to comment.