[all-commits] [llvm/llvm-project] 2812c1: [PowerPC] Fix missing nop after call to weak callee.

stefanp-ibm via All-commits all-commits at lists.llvm.org
Tue Dec 8 07:39:28 PST 2020


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2812c1515627904e31605bbd4f25a887a1f8eb12
      https://github.com/llvm/llvm-project/commit/2812c1515627904e31605bbd4f25a887a1f8eb12
  Author: Stefan Pintilie <stefanp at ca.ibm.com>
  Date:   2020-12-08 (Tue, 08 Dec 2020)

  Changed paths:
    M llvm/lib/Target/PowerPC/PPCISelLowering.cpp
    M llvm/test/CodeGen/PowerPC/ppc64-blnop.ll
    M llvm/test/CodeGen/PowerPC/ppc64-calls.ll
    M llvm/test/CodeGen/PowerPC/ppc64-sibcall.ll
    M llvm/test/CodeGen/PowerPC/pr41088.ll
    M llvm/test/CodeGen/PowerPC/preemption.ll
    M llvm/test/CodeGen/PowerPC/xray-tail-call-hidden.ll

  Log Message:
  -----------
  [PowerPC] Fix missing nop after call to weak callee.

Weak functions can be replaced by other functions at link time. Previously it
was assumed that no matter what the weak callee function was replaced with it
would still share the same TOC as the caller. This is no longer true as a weak
callee with a TOC setup can be replaced by another function that was compiled
with PC Relative and does not have a TOC at all.

This patch makes sure that all calls to functions defined as weak from a caller
that has a valid TOC have a nop after the call to allow a place for the linker
to restore the TOC.

Reviewed By: NeHuang

Differential Revision: https://reviews.llvm.org/D91983




More information about the All-commits mailing list