This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Simplify a Swap if it feeds a Splat
ClosedPublic

Authored by stefanp on Oct 17 2017, 9:38 AM.

Details

Summary

If we have the situation where a Swap feeds a Splat we can sometimes change the index on the Splat and then remove the Swap instruction.

Diff Detail

Repository
rL LLVM

Event Timeline

stefanp created this revision.Oct 17 2017, 9:38 AM
echristo edited edge metadata.Oct 17 2017, 10:55 AM

First pass on review.

lib/Target/PowerPC/PPCMIPeephole.cpp
379 ↗(On Diff #119346)

A bit more elaborate description here please.

389–391 ↗(On Diff #119346)

Style wise we try to avoid single statements in braces.

test/CodeGen/PowerPC/ppc64-peephole-swap.ll
1 ↗(On Diff #119346)

Please add a description of what the testcase is supposed to be testing for each case.

stefanp updated this revision to Diff 119473.Oct 18 2017, 6:10 AM

Fixed style and comment issues based on previous review.

stefanp marked 3 inline comments as done.Oct 18 2017, 6:11 AM
echristo added inline comments.Oct 18 2017, 12:13 PM
lib/Target/PowerPC/PPCMIPeephole.cpp
393 ↗(On Diff #119473)

Early break rather than more indenting please?

403 ↗(On Diff #119473)

This seems problematic if a new splat opcode is ever added. Should we just break and possibly DEBUG?

stefanp updated this revision to Diff 119840.Oct 23 2017, 6:29 AM

Sorry for the late reply Eric. I was on vacation Thursday and Friday last week.

I've made the changes you mentioned.

echristo accepted this revision.Oct 23 2017, 9:59 AM

LGTM. Thanks!

-eric

This revision is now accepted and ready to land.Oct 23 2017, 9:59 AM
This revision was automatically updated to reflect the committed changes.