[PATCH] D141673: [PowerPC][NFC] refactor eligible check for tail call optimization

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 19 16:28:23 PST 2023


nemanjai added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:5650-5660
+  if (Subtarget.useLongCalls() && !(CB && CB->isMustTailCall()))
+    IsTailCall = false;
+  else if (Subtarget.isSVR4ABI() && Subtarget.isPPC64())
+    IsTailCall = IsEligibleForTailCallOptimization_64SVR4(
+        CalleeGV, CalleeCC, CallerCC, CB, isVarArg, Outs, Ins, isByValArg,
+        CallerFunc, isCalleeExternalSymbol);
+  else
----------------
This seems like a strange structure. You have 3 disjoint conditions that each simply set a Boolean variable that is then returned. Why not:
```
if (...)
  return false;
else if (...)
  return IsEligibleForTailCallOptimization_64SVR4(...);
else
  return IsEligibleForTailCallOptimization(...);
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141673



More information about the llvm-commits mailing list