[PATCH] D67088: [PowerPC] extend PPCPreIncPrep Pass for ds/dq form

ChenZheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 2 21:52:40 PDT 2019


shchenz created this revision.
shchenz added a reviewer: hfinkel.
Herald added subscribers: llvm-commits, wuzish, jfb, MaskRay, kbarton, hiraditya, mgorny, nemanjai.
Herald added a project: LLVM.

Now, PPCPreIncPrep pass changes a loop to update form and update all load/store with same base accordingly.

We can do more for load/store with same base, for example, convert load/store with same base to ds/dq form. Like:

  Generically, this means transforming loops like this:

  for (int i = 0; i < n; ++i) {
    unsigned long x1 = *(unsigned long *)(p + i + 5);
   unsigned long x2 = *(unsigned long *)(p + i + 9);
  }



  to look like this:

  unsigned NewP = p + 5;
  for (int i = 0; i < n; ++i) {
      unsigned long x1 = *(unsigned long *)(i + NewP);
      unsigned long x2 = *(unsigned long *)(i + NewP + 4);
  }

I temporaryly only add @hfinkel as a solution reviewer to ensure it is the right place to implement such transform.


https://reviews.llvm.org/D67088

Files:
  llvm/lib/Target/PowerPC/CMakeLists.txt
  llvm/lib/Target/PowerPC/PPC.h
  llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp
  llvm/lib/Target/PowerPC/PPCLoopPreIncPrep.cpp
  llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
  llvm/lib/Target/PowerPC/PPCTargetMachine.cpp.rej
  llvm/test/CodeGen/PowerPC/loop-instr-form-prepare.ll
  llvm/test/CodeGen/PowerPC/ppc-passname.ll
  llvm/test/CodeGen/PowerPC/swaps-le-1.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67088.218400.patch
Type: text/x-patch
Size: 101893 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190903/106f3a77/attachment.bin>


More information about the llvm-commits mailing list