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

Sean Fertile via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 18 13:38:57 PDT 2020


sfertile added inline comments.


================
Comment at: llvm/test/CodeGen/PowerPC/pcrel-local-caller-toc.ll:8
+; enabled and both functions are in the same file.
+; Note that the callee does not know if it clobbers the TOC because it
+; contains an external call to @externalFunc.
----------------
Whats the behavior if we call a function which uses pc-relative instructions to access global data, but has no calls and otherwise preserves the toc-pointer?


================
Comment at: llvm/test/CodeGen/PowerPC/pcrel-local-caller-toc.ll:62
+  %add = add nsw i32 %0, %a
+  %call = tail call signext i32 @callee(i32 signext %add)
+  %mul = mul nsw i32 %call, %call
----------------
If this is instead in tail call position, then the test also documents how we can't tail call from a TOC-based caller to a pc-rel based callee, because we need to restore the toc-pointer after the call.


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

https://reviews.llvm.org/D81126





More information about the llvm-commits mailing list