Page MenuHomePhabricator

[PowerPC] Exploit Prefixed Load/Stores using the refactored Load/Store Implementation
Needs ReviewPublic

Authored by amyk on Feb 4 2021, 1:20 PM.

Details

Reviewers
power-llvm-team
nemanjai
stefanp
Group Reviewers
Restricted Project
Summary

This patch exploits the prefixed load and store instructions utilizing the refactored load/store
implementation introduced in D93370.

Prefixed load and store instructions are emitted whenever we are loading or storing a value with an
offset that fits into a 34-bit signed immediate.
Patterns for the prefixed load and stores are added in this patch, as well as the implementation that
detects when we are loading and storing a value with an offset that fits in 34-bits.

Depends on D95116.

Diff Detail

Event Timeline

amyk created this revision.Feb 4 2021, 1:20 PM
amyk requested review of this revision.Feb 4 2021, 1:20 PM
amyk edited the summary of this revision. (Show Details)Feb 5 2021, 10:02 AM
amyk updated this revision to Diff 322984.Feb 11 2021, 6:08 AM
  • Update LIT test cases with prefixed load/store checks.
  • Added a PrefixInstrs flag.
amyk edited the summary of this revision. (Show Details)Feb 11 2021, 6:11 AM
amyk updated this revision to Diff 323861.Feb 15 2021, 6:09 PM

Address clang-format comments.

amyk updated this revision to Diff 330641.Mon, Mar 15, 6:44 AM
amyk added a reviewer: stefanp.

Update patch based on dependent patch (D95116) update, and update test cases with necessary changes.

Looking at the test case changes there seem to be a few places where we are not generating expected code.
I've added comments to some of those places.

llvm/test/CodeGen/PowerPC/prefixed-ld-st.ll
364

Hmm... that's interesting.
This is probably not related to this patch but this code looks odd.
For starters pstxsd is a D-Form instruction but we are listing two registers and no immediate.

Also,

pli r4, 4294967297
add r3, r3, r4

can probably be written as a paddi.

paddi r3, r3, 4294967297, 0

I feel like we need a TODO for this.

llvm/test/CodeGen/PowerPC/scalar-double-ldst.ll
3135

This doesn't look right.
I assume we are trying to incorporate the pli into the lfsx but somehow the compiler gets confused and doesn't do that. Also, plfs is a D-Form and should have an immediate.

3261

We have expanded the pli into two instructions at this point which we shouldn't do.
Again, I think we are trying to merge pli and lfsx into plfs but that's not working as expected.