[all-commits] [llvm/llvm-project] f2e292: [X86] Unbind the ebx with GOT address in regcall c...

xiangzh1 via All-commits all-commits at lists.llvm.org
Thu Dec 3 18:06:32 PST 2020


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f2e292446334de01403cddb9132ae06cc4475175
      https://github.com/llvm/llvm-project/commit/f2e292446334de01403cddb9132ae06cc4475175
  Author: Xiang1 Zhang <xiang1.zhang at intel.com>
  Date:   2020-12-04 (Fri, 04 Dec 2020)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    A llvm/test/CodeGen/X86/tailregccpic.ll
    A llvm/test/CodeGen/X86/x86-regcall-got.ll

  Log Message:
  -----------
  [X86] Unbind the ebx with GOT address in regcall calling convention

No register can be allocated for indirect call when it use regcall calling
convention and passed 5/5+ args.
For example:
call vreg (ag1, ag2, ag3, ag4, ag5, ...) --> 5 regs (EAX, ECX, EDX, ESI, EDI)
used for pass args, 1 reg (EBX )used for hold GOT point, so no regs can be
allocated to vreg.

The Intel386 architecture provides 8 general purpose 32-bit registers. RA
mostly use 6 of them (EAX, EBX, ECX, EDX, ESI, EDI). 5 of this regs can be
used to pass function arguments (EAX, ECX, EDX, ESI, EDI).
EBX used to hold the GOT pointer when making function calls via the PLT.
ESP and EBP usually be "reserved" in register allocation.

Reviewed By: LuoYuanke

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




More information about the All-commits mailing list