[PATCH] D39777: [PowerPC] implement mayBeEmittedAsTailCall for PPC

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 13 20:37:08 PST 2017


nemanjai added a comment.

Just a few other typos I noticed but forgot to click submit. Wanted to make sure I did so before this gets committed. Feel free to fix these on the commit.



================
Comment at: lib/Target/PowerPC/PPCISelLowering.cpp:4394
+areCallingConvEligibleForTCO_64SVR4(CallingConv::ID CallerCC,
+                                  CallingConv::ID CalleeCC) {
+  // Tail or Sibling call optimization (TCO/SCO) needs callee and caller to
----------------
clang-format this - the parameters don't line up.


================
Comment at: lib/Target/PowerPC/PPCISelLowering.cpp:13807
+  // Can't tail call a function called indirectly, or if it has variadic args.
+  const Function *CalledFunc = CI->getCalledFunction();
+  if (!CalledFunc || CalledFunc->isVarArg())
----------------
Elsewhere in this code, the callee is named `Callee`, why change to `CalledFunc`?


================
Comment at: lib/Target/PowerPC/PPCISelLowering.h:1090
+    // tail call. This will cause the optimizers to attempt to move, or
+    // duplicate,return instructions to help enable tail call optimizations.
+    bool mayBeEmittedAsTailCall(const CallInst *CI) const override;
----------------
`s/duplicate,return/duplicate return`


================
Comment at: test/CodeGen/PowerPC/duplicate-returns-for-tailcall.ll:21
+  br label %return
+; The return should get duplciated here to enable a tail-call opertunity.
+; CHECK-LABEL: if.then:
----------------
s/opertunity/opportunity


Repository:
  rL LLVM

https://reviews.llvm.org/D39777





More information about the llvm-commits mailing list