[PATCH] D73664: [PowerPC][Future] Add Support For Functions That Do Not Use A TOC.

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 23 08:09:14 PDT 2020


nemanjai accepted this revision.
nemanjai added a comment.
This revision is now accepted and ready to land.

LGTM. The remaining comments are just nits that you can address on the commit. Thanks for your patience through this review and for addressing all the comments.



================
Comment at: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1472
+  // Only do all that if the function uses r2 in the first place.
+  if (Subtarget->isELFv2ABI() && UsesX2OrR2 && PPCFI->usesTOCBasePtr()) {
     // Note: The logic here must be synchronized with the code in the
----------------
Nit: At first glance, I thought this should have been:
`Subtarget->isELFv2ABI() && (UsesX2OrR2 || PPCFI->usesTOCBasePtr())`

But I realize now that it is correct the way you wrote it. There should be a comment explaining it though. Perhaps something along the lines of:
```
- // Only do all that if the function uses r2 in the first place.
+ // Only do all that if the function uses R2 as the TOC pointer
+ // in the first place. We don't need the global entry point if the
+ // function uses R2 as an allocatable register.
```
```


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

https://reviews.llvm.org/D73664





More information about the llvm-commits mailing list