Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consolidate math call transformations in recognizedCallTransformer #2320

Merged
merged 4 commits into from
Jul 12, 2018

Conversation

dhong44
Copy link
Contributor

@dhong44 dhong44 commented Jul 4, 2018

Move transformations from java/lang/math calls to opcodes
into recognized call transformer optimization and add
transformations for Z.

Closes: #2045

Signed-off-by: Daniel Hong daniel.hong@live.com

@dhong44
Copy link
Contributor Author

dhong44 commented Jul 4, 2018

Depends on eclipse-omr/omr#2711 and eclipse-omr/omr#2722

@dhong44
Copy link
Contributor Author

dhong44 commented Jul 4, 2018

@fjeremic

@fjeremic fjeremic self-assigned this Jul 4, 2018
@fjeremic fjeremic added comp:jit depends:omr Pull request is dependent on a corresponding change in OMR labels Jul 4, 2018
@dhong44 dhong44 changed the title WIP: Consolidate math call transformations in recognizedCallTransformer Consolidate math call transformations in recognizedCallTransformer Jul 6, 2018
TR::Compiler->target.cpu.isPower() ||
TR::Compiler->target.cpu.isZ() ||
TR::Compiler->target.cpu.isARM() && !disableARMMaxMin) &&
!comp()->getOption(TR_DisableMaxMinOptimization);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we able to eliminate these platform checks and the disableARMMaxMin static variables by simply setting TR_DisableMaxMinOptimization on ARM? Similarly below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

c03fdfd

@0dvictor
Copy link
Contributor

0dvictor commented Jul 9, 2018

The proposed change implicitly enabled transforming [i/l]abs on X86 while not deleting old related X86 CodeGen logic, it might be better to wait for #2360

@0dvictor
Copy link
Contributor

Thank you for waiting. #2360 has now been merged. This PR may need a rebase to reflect the latest change.

@@ -48,22 +48,34 @@ void J9::RecognizedCallTransformer::processIntrinsicFunction(TR::TreeTop* treeto
TR::TransformUtil::removeTree(comp(), treetop);
}


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra new line not needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a207c22

TR::Compiler->target.cpu.isPower() ||
TR::Compiler->target.cpu.isZ() ||
TR::Compiler->target.cpu.isARM()) &&
!comp()->getOption(TR_DisableMaxMinOptimization);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still need to fold all of these platform checks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a207c22

Copy link
Contributor

@0dvictor 0dvictor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#2360 doesn't seem being included in your branch. Please rebase it to the latest OpenJ9 master before merging this PR.

case TR::java_lang_Math_max_D:
case TR::java_lang_Math_min_D:
return (TR::Compiler->target.cpu.isARM()) &&
!comp()->getOption(TR_DisableMaxMinOptimization);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already set on ARM so we don't need the isARM platform check.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since only arm supports transformation of Max and Min calls, without the isARM check this would always return false. I intended to leave this code so in the future it could be enabled on ARM. Instead, should the cases for floating point max and min calls just be removed?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead, should the cases for floating point max and min calls just be removed?

I think so yes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dhong44 added 4 commits July 11, 2018 17:45
Move transformations from java/lang/math calls to opcodes
into recognized call transformer optimization and add
transformations for Z.

Closes: eclipse-openj9#2045

Signed-off-by: Daniel Hong <daniel.hong@live.com>
Remove booleans that were previously used as placeholders
for ARM. Setting options to disable features will be done
with OMR Options instead.

Signed-off-by: Daniel Hong <daniel.hong@live.com>
Remove platform check in J9RecognizedCallTransformer
for max and min operations, since all platforms
support call transformation.

Signed-off-by: Daniel Hong <daniel.hong@live.com>
Remove cases in recognized call transformer dealing with
max/min calls using floating point numbers.

Signed-off-by: Daniel Hong <daniel.hong@live.com>
@fjeremic
Copy link
Contributor

Jenkins test sanity

@dhong44
Copy link
Contributor Author

dhong44 commented Jul 12, 2018

Windows failures due to #2129.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:jit depends:omr Pull request is dependent on a corresponding change in OMR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants