[PATCH] D64424: [AIX] Implement LR prolog/epilog save/restore

Sean Fertile via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 24 08:13:07 PDT 2019


sfertile added a comment.

I'll have to dig into the AIX ABI docs before I can review this more thoroughly but it looks good. I suggest we split out renaming of the hardcoded '8' to --> `getCRSaveOffset()` as a separate NFC patch and that we can land immediately.



================
Comment at: llvm/lib/Target/PowerPC/PPCFrameLowering.cpp:796
+  assert((Subtarget.isDarwinABI() || isSVR4ABI || isAIXABI) &&
+         "Currently only Darwin, SVR4 and AIX ABIs are supported for "
+         "PowerPC.");
----------------
minor nit: Can we just say `Unsupported PPC ABI`?


================
Comment at: llvm/lib/Target/PowerPC/PPCFrameLowering.cpp:804
+      if (MBBI->getOpcode() == PPC::UPDATE_VRSAVE) {        
+        if (isAIXABI)
+          report_fatal_error("VRSAVE is unimplemented on AIX");        
----------------
FWIW according to the original commit that guards this for ELF it shouldn't be needed for AIX either:

```
commit 38d945872097549606ea62b64ded743afdab0648
Author: Bill Schmidt <wschmidt at linux.vnet.ibm.com>
Date:   Wed Oct 10 20:54:15 2012 +0000

    The PowerPC VRSAVE register has been somewhat of an odd beast since
    the Altivec extensions were introduced.  Its use is optional, and
    allows the compiler to communicate to the operating system which
    vector registers should be saved and restored during a context switch.
    In practice, this information is ignored by the various operating
    systems using the SVR4 ABI; the kernel saves and restores the entire
    register state.  Setting the VRSAVE register is no longer performed by
    the AIX XL compilers, the IBM i compilers, or by GCC on Power Linux
    systems.  It seems best to avoid this logic within LLVM as well.
    
    This patch avoids generating code to update and restore VRSAVE for the
    PowerPC SVR4 ABIs (32- and 64-bit).  The code remains in place for the
    Darwin ABI.
    
    llvm-svn: 165656
```



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64424/new/

https://reviews.llvm.org/D64424





More information about the llvm-commits mailing list