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

Z: remove unused and redundant register from object evaluator #19860

Conversation

ehsankianifar
Copy link
Contributor

Repurpose registers when no longer needed.
Remove unused registers.
Use scratch register manager inside genHeapAlloc

@ehsankianifar
Copy link
Contributor Author

@r30shah please review when possible. Thanks.
Sanity tests pass with disabled batch clear (build 23202)

@ehsankianifar ehsankianifar force-pushed the Z_RemoveUnusedRegistersFromGenHeapAlloc branch from ee8100c to 122a837 Compare July 16, 2024 02:57
}

iCursor = generateS390BranchInstruction(cg, TR::InstOpCode::BRC, TR::InstOpCode::COND_BNE, node, callLabel, iCursor);
iCursor = generateRILInstruction(cg, TR::InstOpCode::CLFI, node, enumReg, (1 << 16), iCursor);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

To eliminate the need for a register (tmp)

@r30shah
Copy link
Contributor

r30shah commented Jul 16, 2024

Hi @ehsankianifar please update the commit body with appropriate explanation of what the change is about and shorten the commit title withing 72 letters.

@ehsankianifar ehsankianifar force-pushed the Z_RemoveUnusedRegistersFromGenHeapAlloc branch from 122a837 to 90c1a7a Compare July 16, 2024 13:01
@r30shah
Copy link
Contributor

r30shah commented Jul 19, 2024

@ehsankianifar The build you launched was only ran on x86, not LoZ (#19860 (comment)).

I am still suspicious of some of the registers you removed as there are many different type of cases this will be used so I am going to do thorough review today.

Given the scope of area this change will be touching, please launch internal jenkins build on Linux on Z with JDK11 and JDK21 for sanity and extended test target (functional / system and openjdk). Also launch Java 8 vmfarm build on z/OS and Linux on Z with c,p target as well.

@ehsankianifar
Copy link
Contributor Author

Thanks @r30shah for checking that. I start a new build right now

@ehsankianifar ehsankianifar force-pushed the Z_RemoveUnusedRegistersFromGenHeapAlloc branch from 90c1a7a to e1e6e7d Compare July 19, 2024 15:20
Copy link
Contributor

@r30shah r30shah left a comment

Choose a reason for hiding this comment

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

Thanks @ehsankianifar for going in the evaluator and cleaning up some part of the code. Overall looked OK to me, but I would like to give one more look specially around the use of Scratch register manager. I have requested some minor changes (Mostly clarifying comments and renaming some of the variable names). Please make this changes as seperate single commit so it is easier to review.

runtime/compiler/z/codegen/J9TreeEvaluator.cpp Outdated Show resolved Hide resolved
runtime/compiler/z/codegen/J9TreeEvaluator.cpp Outdated Show resolved Hide resolved
runtime/compiler/z/codegen/J9TreeEvaluator.cpp Outdated Show resolved Hide resolved
runtime/compiler/z/codegen/J9TreeEvaluator.cpp Outdated Show resolved Hide resolved
runtime/compiler/z/codegen/J9TreeEvaluator.cpp Outdated Show resolved Hide resolved
runtime/compiler/z/codegen/J9TreeEvaluator.cpp Outdated Show resolved Hide resolved
runtime/compiler/z/codegen/J9TreeEvaluator.cpp Outdated Show resolved Hide resolved
runtime/compiler/z/codegen/J9TreeEvaluator.cpp Outdated Show resolved Hide resolved
runtime/compiler/z/codegen/J9TreeEvaluator.cpp Outdated Show resolved Hide resolved
@ehsankianifar ehsankianifar marked this pull request as draft July 19, 2024 21:32
@ehsankianifar ehsankianifar force-pushed the Z_RemoveUnusedRegistersFromGenHeapAlloc branch 2 times, most recently from 0c60909 to 520ea62 Compare July 23, 2024 01:07
@ehsankianifar
Copy link
Contributor Author

@r30shah I addressed the comments in a separate commit as you requested. I can squash the commits after the review or leave it as it is. The tests are passing for the java 8 with c,p tests target on zos and zLinux (build number 34097).
The sanity and extended tests mostly passed with java 11 and 21 on zLinux (build 23269).
some tests are still running. I will check later and post update.

@ehsankianifar
Copy link
Contributor Author

sanity.functional tests were aborted on both jdk21 and jdk11 builds. both passed on rerun (grinder 42320 and 42321)
all other tests passed as well.

Copy link
Contributor

@r30shah r30shah left a comment

Choose a reason for hiding this comment

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

Small nitpicks, please squash the commits and move to from draft to ready for review.

runtime/compiler/z/codegen/J9TreeEvaluator.cpp Outdated Show resolved Hide resolved
runtime/compiler/z/codegen/J9TreeEvaluator.cpp Outdated Show resolved Hide resolved
@ehsankianifar ehsankianifar force-pushed the Z_RemoveUnusedRegistersFromGenHeapAlloc branch from 520ea62 to 94f29f7 Compare July 23, 2024 13:43
@ehsankianifar ehsankianifar marked this pull request as ready for review July 23, 2024 18:10
@r30shah
Copy link
Contributor

r30shah commented Jul 24, 2024

@ehsankianifar Can you squash the commits ?

VMnewEvaluator uses more registers than it needs.
Some registers like zeroReg are initialized but never used.
Some registers line dataSizeReg are redundant.
This commit uses existing registers as much as possible and
removes all the unused or redundant registers.
It also uses scratch register manager in genHeapAlloc for
better register allocation.

Signed-off-by: Ehsan Kiani Far <ehsan.kianifar@gmail.com>
@ehsankianifar ehsankianifar force-pushed the Z_RemoveUnusedRegistersFromGenHeapAlloc branch from 94f29f7 to b4719f8 Compare July 24, 2024 14:15
@ehsankianifar
Copy link
Contributor Author

@r30shah commits squashed!

@r30shah
Copy link
Contributor

r30shah commented Jul 24, 2024

jenkins test sanity zlinux jdk21

@r30shah r30shah merged commit 157a0ef into eclipse-openj9:master Jul 24, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants