]> granicus.if.org Git - llvm/commit
[PowerPC] Reduce register pressure by not materializing a constant just for use as...
authorLei Huang <lei@ca.ibm.com>
Mon, 10 Jul 2017 16:44:45 +0000 (16:44 +0000)
committerLei Huang <lei@ca.ibm.com>
Mon, 10 Jul 2017 16:44:45 +0000 (16:44 +0000)
commitb6988767a83875c8d0a64a1c0ff9cdf962d556ab
tree2fea04e610771f032783ccbc08c60076c2937507
parent0fd6ce773dc03bd9901ad277bf045244a39ffc3a
[PowerPC] 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
Differential Revision: https://reviews.llvm.org/D35027

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307553 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/PPCISelLowering.cpp
test/CodeGen/PowerPC/build-vector-tests.ll
test/CodeGen/PowerPC/ppc64le-smallarg.ll
test/CodeGen/PowerPC/select-addrRegRegOnly.ll [new file with mode: 0644]
test/CodeGen/PowerPC/vsx-partword-int-loads-and-stores.ll