[PATCH] D39860: [PowerPC] Simplify a Swap if it feeds a Splat

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 5 11:49:45 PST 2018


nemanjai accepted this revision.
nemanjai added a comment.
This revision is now accepted and ready to land.

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.



================
Comment at: lib/Target/PowerPC/PPCMIPeephole.cpp:490
+          else {
+            DEBUG(dbgs() << "Unknown splat opcode.");
             DEBUG(MI.dump());
----------------
I think it would be better use unreachable here since we really shouldn't be in this block.


================
Comment at: test/CodeGen/PowerPC/ppc-xxsldwi-peephole.ll:15
+; CHECK-LABEL: test
+; CHECK: vspltb
+; CHECK: blr
----------------
I would much prefer that we specify what we're testing here a little more strictly.
- The output register will be `2` since that's mandated by the ABI
- The immediate should be specified
- The `blr` should be a `CHECK-NEXT`


================
Comment at: test/CodeGen/PowerPC/ppc64-peephole-swap.ll:5
+; The strightforward expansion of this code will result in a swap followed by a
+;  splat. However, the swap is not needed since in this case the splat is the
+;  only use.
----------------
Just a minor nit (especially since this is in a test case): we never indent anything by 1 space. If it is indented, it is indented by a multiple of 2 spaces.


https://reviews.llvm.org/D39860





More information about the llvm-commits mailing list