[PATCH] D35027: [PowerPC] Reduce register pressure by not materializing a constant just for use as an index register for X-Form loads/stores

Lei Huang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 5 11:41:20 PDT 2017


lei created this revision.

Reduce register pressure by not materializing a constant just for use as an index register for X-Form loads/stores.

For this example:

  float test (int *arr) {
    return arr[2];
  }

We currently generate the following code:

  li r4, 8
  lxsiwax f0, r3, r4
  xscvsxdsp f1, f0

With this patch, we will now generate:

  addi r3, r3, 8
  lxsiwax f0, 0, r3
  xscvsxdsp f1, f0

Originally reported in: https://bugs.llvm.org/show_bug.cgi?id=27204


https://reviews.llvm.org/D35027

Files:
  lib/Target/PowerPC/PPCISelLowering.cpp
  test/CodeGen/PowerPC/build-vector-tests.ll
  test/CodeGen/PowerPC/ppc64le-smallarg.ll
  test/CodeGen/PowerPC/select-addrRegRegOnly.ll
  test/CodeGen/PowerPC/vsx-partword-int-loads-and-stores.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35027.105312.patch
Type: text/x-patch
Size: 5438 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170705/345b53ba/attachment.bin>


More information about the llvm-commits mailing list