[PATCH] D77749: [PowerPC][Future] Remove redundant r2 save and restore for indirect call

Amy Kwan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 14 20:40:13 PDT 2020


amyk added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:5129
 
+// For 64-bit ELFv2 ABI with PCRel, TOC save/restore is not required.
+static inline bool isTOCSaveRestoreRequired(const PPCSubtarget &Subtarget) {
----------------
Is it worth mentioning AIX in the comment too, since the check also considers AIX?


================
Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:6501
+    // For 64-bit ELFv2 ABI with PCRel, do not save the TOC of the
+    // caller in the TOC save area
+    if (isTOCSaveRestoreRequired(Subtarget)) {
----------------
nit: End with period.


================
Comment at: llvm/test/CodeGen/PowerPC/pcrel-indirect-call.ll:3
+; RUN:   -mcpu=future -ppc-asm-full-reg-names < %s | FileCheck %s \
+; RUN:   --check-prefix=CHECK
+
----------------
I don't believe the FileCheck prefix is needed if you wanted to prefix to say `CHECK`. 
`CHECK` should be the default if no prefix is supplied. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77749





More information about the llvm-commits mailing list