[PATCH] D14080: [PowerPC] Add an MI SSA peephole pass.

Bill Schmidt via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 26 09:32:18 PDT 2015


wschmidt created this revision.
wschmidt added reviewers: hfinkel, kbarton, nemanjai.
wschmidt added a subscriber: llvm-commits.
wschmidt set the repository for this revision to rL LLVM.

This patch adds	a pass for doing PowerPC peephole optimizations at the MI level while the code is still in SSA form.  This allows for easy modifications to the instructions while depending on a subsequent pass of DCE.  Both passes are very fast due to the characteristics of SSA.

At this time, the only peepholes added are for cleaning	up various redundancies involving the XXPERMDI instruction.  However, I would expect this will be a useful place to add more peepholes for
inefficiencies generated during instruction selection.  The pass is placed after VSX swap optimization, as it is best to let that pass remove unnecessary swaps before performing any remaining clean-ups.

The utility of these clean-ups are demonstrated by changes to four existing test cases, all of which now have tighter expected code generation.  I've also added Eric Schweiz's bugpoint-reduced test from PR25157, for which we now generate tight code. 	One other test started failing for me, and I've fixed it
(test/Transforms/PlaceSafepoints/finite-loops.ll) as well; this	is not related to my changes, and I'm not sure why it works before and not after.  The problem is that the CHECK-NOT: of "statepoint" from	test1 fails because of the "statepoint" in test2, and so forth.  Adding a CHECK-LABEL in between keeps the different occurrences of that string properly scoped.


Repository:
  rL LLVM

http://reviews.llvm.org/D14080

Files:
  lib/Target/PowerPC/PPC.h
  lib/Target/PowerPC/PPCMIPeephole.cpp
  lib/Target/PowerPC/PPCTargetMachine.cpp
  test/CodeGen/PowerPC/pr25157-peephole.ll
  test/CodeGen/PowerPC/swaps-le-5.ll
  test/CodeGen/PowerPC/swaps-le-6.ll
  test/CodeGen/PowerPC/vsx_insert_extract_le.ll
  test/CodeGen/PowerPC/vsx_shuffle_le.ll
  test/Transforms/PlaceSafepoints/finite-loops.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14080.38426.patch
Type: text/x-patch
Size: 17508 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151026/ce782a69/attachment.bin>


More information about the llvm-commits mailing list