Skip to content

Z peephole: Remove unnecessary L(L)GFR - #7393

Merged
0xdaryl merged 1 commit into
eclipse-omr:masterfrom
Spencer-Comin:peepholes
Sep 12, 2024
Merged

Z peephole: Remove unnecessary L(L)GFR#7393
0xdaryl merged 1 commit into
eclipse-omr:masterfrom
Spencer-Comin:peepholes

Conversation

@Spencer-Comin

Copy link
Copy Markdown
Contributor

A 32 bit load instruction followed by a zero/sign extend instruction can be replaced with an equivalent load and zero/sign extend instruction.

Here are all the replacements done by this peephole:

opcode LGFR R1,R1 LLGFR R1,R1
L R1,M1* LGF R1,M1* LLGF R1,M1*
LH R1,M1* LGH R1,M1* N/A
LLH R1,M1* N/A LLGH R1,M1*
LB R1,M1* LGB R1,M1* N/A
LLC R1,M1* N/A LLGC R1,M1*
XR R1,R1 XGR R1,R1 XGR R1,R1
IILF R1,I1 LGFI R1,I1 LLILF R1,I1
LHI R1,I1 LGHI R1,I1 LLILF R1,I2**
LR R1,R2 LGFR R1,R2 LLGFR R1,R2
LGR R1,R2 LGFR R1,R2 LLGFR R1,R2

*M1 is an arbitrary memory reference
**I2 is I1 sign extended from 16 to 32 bits

@Spencer-Comin

Copy link
Copy Markdown
Contributor Author

Passing internal jdk11 sanity.functional, sanity.system, and sanity.openjdk tests: https://hyc-runtimes-jenkins.swg-devops.com/view/OpenJ9%20-%20Personal/job/Pipeline-Build-Test-Personal/23145/

A few failures in internal jdk8 tests, I'm currently investigating to see if they are related: http://vmfarm.rtp.raleigh.ibm.com/build_info.php?build_id=74326

@Spencer-Comin

Copy link
Copy Markdown
Contributor Author

Rebased and retried the internal jdk8 tests (http://vmfarm.rtp.raleigh.ibm.com/build_info.php?build_id=74679). There were no failures, so I'm taking this PR off of draft.

@Spencer-Comin
Spencer-Comin marked this pull request as ready for review July 17, 2024 14:39
@Spencer-Comin
Spencer-Comin requested a review from fjeremic as a code owner July 17, 2024 14:39
@Spencer-Comin

Copy link
Copy Markdown
Contributor Author

@r30shah fyi

@0xdaryl

0xdaryl commented Jul 30, 2024

Copy link
Copy Markdown
Contributor

@r30shah : Please review

@r30shah r30shah left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I apologize @Spencer-Comin, this fell out of my radar. Just finished the review. Overall looks OK to me, posted some minon concerns I had in review.

Comment thread compiler/z/codegen/OMRPeephole.hpp
Comment thread compiler/z/codegen/OMRPeephole.cpp Outdated
Comment thread compiler/z/codegen/OMRPeephole.cpp Outdated
Comment thread compiler/z/codegen/OMRPeephole.cpp Outdated
Comment thread compiler/z/codegen/OMRPeephole.cpp Outdated
Comment thread compiler/z/codegen/OMRPeephole.cpp Outdated
Comment thread compiler/z/codegen/OMRPeephole.cpp
Comment thread compiler/z/codegen/OMRPeephole.cpp Outdated
A 32 bit load instruction followed by a zero/sign extend instruction can be
replaced with an equivalent load and zero/sign extend instruction.

Signed-off-by: Spencer Comin <spencer.comin@ibm.com>

@r30shah r30shah left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@r30shah

r30shah commented Aug 2, 2024

Copy link
Copy Markdown
Contributor

Jenkins build zos,zlinux

@0xdaryl 0xdaryl self-assigned this Sep 12, 2024
@0xdaryl

0xdaryl commented Sep 12, 2024

Copy link
Copy Markdown
Contributor

Jenkins build zos,zlinux

Previous testing from early August passed, but running again.

@0xdaryl
0xdaryl merged commit 8c233cd into eclipse-omr:master Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants