[PATCH] D139691: [PowerPC] add a peephole to remove redundant swap instructions after vector splats on P8

ChenZheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 13 19:10:44 PST 2022


shchenz added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCMIPeephole.cpp:647
           LLVM_DEBUG(MI.dump());
+        } else if (Immed == 2 &&
+                   (DefOpc == PPC::VSPLTB || DefOpc == PPC::VSPLTH ||
----------------
tingwang wrote:
> shchenz wrote:
> > Can this branch be merged to the above one at line 627? Splat a double word and the double word is a splat of a small unit should also can be removed?
> Sure, I can do the merge to reuse logic. 
> 
> Are you referring to instructions like xxspltib? I think those are introduced in v3.0, and they will not appear on P8, so I did not include those.
Oh, I meant the `XXPERMDI` instruction can be removed like the above branch(at like 627) does. Not referring to any other instructions.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139691/new/

https://reviews.llvm.org/D139691



More information about the llvm-commits mailing list