Modify the peephole optimization for PowerPC so that it doesn't just simplify a shift feeding a splat but also a swap feeding a splat.
Also fixed a small bug in the original shift feeds splat code.
Paths
| Differential D39860
[PowerPC] Simplify a Swap if it feeds a Splat AbandonedPublic Authored by stefanp on Nov 9 2017, 12:18 PM.
Details
Diff Detail Event TimelineComment Actions This looks good, but of course, lets run this through all the testing before committing. Also, I think that for the test cases you added, you don't expect to see any swaps. You should be able to add -implicit-check-not to the RUN lines.
This revision is now accepted and ready to land.Nov 9 2017, 2:19 PM Comment Actions Fixed the issue where we could have assigned a VSR register to an instruction that requires a VR register. Comment Actions Thank you for fixing the issue with the register class - it has clearly existed in this code before your patch as well. My comments are minor nits. The patch looks good to me, please run some tests with the verifier turned on and commit when you have a clean result.
This revision is now accepted and ready to land.Feb 5 2018, 11:48 AM Comment Actions This feature has already been covered by https://reviews.llvm.org/D77448
Revision Contents
Diff 132844 lib/Target/PowerPC/PPCMIPeephole.cpp
test/CodeGen/PowerPC/p8-scalar_vector_conversions.ll
test/CodeGen/PowerPC/ppc-xxsldwi-peephole.ll
test/CodeGen/PowerPC/ppc64-peephole-swap.ll
test/CodeGen/PowerPC/vsx.ll
|
Since you're adding ImmOpNo as well, please rename this to RegOpNo to make it clear. I know we generally don't rename things in the patch like this, but I think it's OK here because it is the introduction of the new one that requires this one to be renamed.