[PATCH] D81126: [PowerPC] Fix for PC Relative call protocol

Sean Fertile via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 25 09:07:39 PDT 2020


sfertile added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:4724
+      CodeModel::Large == TM.getCodeModel()) {
+    if (!TM.shouldAssumeDSOLocal(*Caller->getParent(), GV))
+      return false;
----------------
This check was split from the small code model one below since for medium and large code model it was a suffcient condition, while small code model it was only a necessary condition. Now its simply a necessary condition for all code models so we can colapse the 2 checks into a single check with return on false. 

If you want some help combining the 2 long comments into one we can do so together in slack if you like.


================
Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:4748
+    // functions do not share a TOC base.
+    if (STICallee->isUsingPCRelativeCalls())
+      return false;
----------------
Do we only check this when targeting large/medium code model because PCRel calls is exclusive to medium code model? If the callee and caller already have different attributes, could they have differing code models as well? The case I'm thinking about would be if callee/caller are in different modules say in a lto or thin lto compile.


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

https://reviews.llvm.org/D81126





More information about the llvm-commits mailing list