[PATCH] D97367: [PowerPC] Allow spilling GPR to VSR on AIX

Qiu Chaofan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 24 01:44:12 PST 2021


qiucf created this revision.
qiucf added reviewers: syzaara, nemanjai, jsji, PowerPC.
Herald added subscribers: shchenz, kbarton, hiraditya, qcolombet.
qiucf requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This patch enables spilling GPR to VSRs instead of stack (implemented in rGfcd9697 <https://reviews.llvm.org/rGfcd9697d72eee33614a4441d63526349d08710fa>) under AIX ABI.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D97367

Files:
  llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp
  llvm/test/CodeGen/PowerPC/gpr-vsr-spill.ll


Index: llvm/test/CodeGen/PowerPC/gpr-vsr-spill.ll
===================================================================
--- llvm/test/CodeGen/PowerPC/gpr-vsr-spill.ll
+++ llvm/test/CodeGen/PowerPC/gpr-vsr-spill.ll
@@ -1,4 +1,6 @@
 ; RUN: llc -verify-machineinstrs -mcpu=pwr9 -mtriple=powerpc64le-unknown-linux-gnu -ppc-enable-gpr-to-vsr-spills  < %s | FileCheck %s
+; RUN: llc -verify-machineinstrs -mcpu=pwr9 -mtriple=powerpc64-ibm-aix-xcoff -ppc-enable-gpr-to-vsr-spills -vec-extabi < %s | FileCheck %s
+
 define signext i32 @foo(i32 signext %a, i32 signext %b) {
 entry:
   %cmp = icmp slt i32 %a, %b
Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp
===================================================================
--- llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp
+++ llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp
@@ -452,7 +452,7 @@
     // For Power9 we allow the user to enable GPR to vector spills.
     // FIXME: Currently limited to spilling GP8RC. A follow on patch will add
     // support to spill GPRC.
-    if (TM.isELFv2ABI()) {
+    if (TM.isELFv2ABI() || Subtarget.isAIXABI()) {
       if (Subtarget.hasP9Vector() && EnableGPRToVecSpills &&
           RC == &PPC::G8RCRegClass) {
         InflateGP8RC++;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97367.326019.patch
Type: text/x-patch
Size: 1222 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210224/aab000c7/attachment.bin>


More information about the llvm-commits mailing list