[all-commits] [llvm/llvm-project] ae8507: [X86] Don't clobber EBX in stackprobes

Elliot Saba via All-commits all-commits at lists.llvm.org
Tue Sep 7 12:01:35 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ae8507b0df738205a6b9e3795ad34672b7499381
      https://github.com/llvm/llvm-project/commit/ae8507b0df738205a6b9e3795ad34672b7499381
  Author: Elliot Saba <staticfloat at gmail.com>
  Date:   2021-09-07 (Tue, 07 Sep 2021)

  Changed paths:
    M llvm/lib/Target/X86/X86FrameLowering.cpp
    M llvm/test/CodeGen/X86/stack-clash-large.ll

  Log Message:
  -----------
  [X86] Don't clobber EBX in stackprobes

On X86, the stackprobe emission code chooses the `R11D` register, which
is illegal on i686.  This ends up wrapping around to `EBX`, which does
not get properly callee-saved within the stack probing prologue,
clobbering the register for the callers.

We fix this by explicitly using `EAX` as the stack probe register.

Reviewed By: pengfei

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




More information about the All-commits mailing list