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

Allow some Unsafe atomic ops to be inlined on POWER #3086

Merged
merged 5 commits into from
Nov 13, 2018

Conversation

hzongaro
Copy link
Member

@hzongaro hzongaro commented Oct 1, 2018

Allow for the possibility that the parent OMR class will want to
inline a direct call by delegating to the parent class's implementation
of inlineDirectCall. In particular, we will want to do that for some
atomic operations in Unsafe.

This depends on eclipse-omr/omr#3018

Signed-off-by: Henry Zongaro [email protected]

Allow for the possibility that the parent OMR class will want to
inline a direct call by delegating to the parent class's implementation
of inlineDirectCall.  In particular, we will want to do that for some
atomic operations in Unsafe.

Signed-off-by:  Henry Zongaro <[email protected]>
@hzongaro
Copy link
Member Author

hzongaro commented Oct 1, 2018

May I ask @0dvictor @zl-wang @gita-omr to review?

@fjeremic fjeremic added comp:jit depends:omr Pull request is dependent on a corresponding change in OMR labels Oct 2, 2018
|| TR::Compiler->target.cpu.isPower())
&& !comp()->getOption(TR_DisableUnsafe)
&& !comp()->compileRelocatableCode()
&& !TR::Compiler->om.canGenerateArraylets();
Copy link
Contributor

Choose a reason for hiding this comment

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

These queries will need updating after eclipse-omr/omr#2999 is merged. I suggest we mark this PR as WIP until this is done.

@andrewcraik
Copy link
Contributor

@hzongaro eclipse-omr/omr#2999 has been merged - can you update to account for that change so that review can progress?

@fjeremic
Copy link
Contributor

fjeremic commented Oct 9, 2018

@hzongaro eclipse/omr#2999 has been merged - can you update to account for that change so that review can progress?

I think a large part of this PR is made redundant by #3195. @hzongaro given #3195 I think you only need the runtime/compiler/p/codegen/J9TreeEvaluator.cpp changes here.

@andrewcraik
Copy link
Contributor

@hzongaro can you look at the comments from @fjeremic and update the PR?

Allow for the possibility that the parent OMR class will want to
inline a direct call by delegating to the parent class's implementation
of inlineDirectCall.  In particular, we will want to do that for some
atomic operations in Unsafe.

Signed-off-by:  Henry Zongaro <[email protected]>
Removed checks of platform for determining whether atomic helpers are
supported.

Signed-off-by:  Henry Zongaro <[email protected]>
@fjeremic fjeremic self-assigned this Oct 23, 2018
Adjusted call to overridden inlineDirectCall to be done through the
connector, rather than calling the implementation of
OMR::Power::CodeGenerator::inlineDirectCall directly.

Signed-off-by:  Henry Zongaro <[email protected]>
@hzongaro hzongaro changed the title Allow some Unsafe atomic ops to be inlined on POWER WIP: Allow some Unsafe atomic ops to be inlined on POWER Oct 30, 2018
@hzongaro hzongaro changed the title WIP: Allow some Unsafe atomic ops to be inlined on POWER Allow some Unsafe atomic ops to be inlined on POWER Nov 8, 2018
@hzongaro
Copy link
Member Author

hzongaro commented Nov 8, 2018

I believe all review comments have been addressed, so I will remove "WIP" from the title.

@fjeremic
Copy link
Contributor

fjeremic commented Nov 8, 2018

Jenkins test sanity plinux,aix JDK8

@andrewcraik
Copy link
Contributor

@fjeremic were you going to merge this or do we need to get another opinion before you are ready to merge it?

@gita-omr
Copy link
Contributor

I would like to take a look before merge.

@fjeremic fjeremic assigned gita-omr and unassigned fjeremic Nov 12, 2018
@fjeremic
Copy link
Contributor

@fjeremic were you going to merge this or do we need to get another opinion before you are ready to merge it?

I'll delegate to @gita-omr given the above comment.

@gita-omr gita-omr merged commit 05b4a2b into eclipse-openj9:master Nov 13, 2018
@gita-omr
Copy link
Contributor

Just wanted to mention that I merged this PR to fix the build. However, we still need to discuss why this inlineDriectCall check is needed. E.g. it would be good to have only one place where we ask if any particular CodeGenerator can inline these atomic ops.

@gita-omr
Copy link
Contributor

To follow up on our discussion @hzongaro @fjeremic @0dvictor adding an ASSERT in the evaluator (inlineDirectCall || !supportsNonHelper) would be slightly misleading since supportsNonHelper (at least from its name) does not imply that the helper has to be inlined.
It's not the first place where we have some kind of handshake between IL gen, optimizer, and codegen and things need to be kept manually in sync. But I think the more accurate the name of the query is the better. If we call it supportsNonHelper let's assume that codegen will handle it one way or another (maybe by inlining or maybe by generating a call to something else). If we want to indicate that this nonHelper definitely needs to be inlined, then let's call it inlinesNonHelper().

Also, I think checking for 64bit should be done inside supports/inlinesNonHelper().

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.

4 participants