[all-commits] [llvm/llvm-project] ba8a52: [X86] Fix the base pointer save/restore bug

Luo, Yuanke via All-commits all-commits at lists.llvm.org
Sat Feb 25 05:13:13 PST 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ba8a520512b7c36a9958ddbf9be96a33ed0279b8
  Author: Luo, Yuanke <yuanke.luo at intel.com>
  Date:   2023-02-25 (Sat, 25 Feb 2023)

  Changed paths:
    M llvm/lib/Target/X86/X86FrameLowering.cpp
    M llvm/lib/Target/X86/X86MachineFunctionInfo.h
    M llvm/test/CodeGen/X86/sjlj-baseptr.ll

  Log Message:
  [X86] Fix the base pointer save/restore bug

Previous the stack slot for spilling base pointer register is allocated
after the stack realignment. When the stack is naturally aligned the
stack slot is share with other data that allocated from stack and cause
data corrupt. Another issue is the stack slot for save/restore the
callee saved register is not fixed for each function. It depends on the
register usage of them in each function.

This patch is to recalculate the offset the stack slot for base pointer
register during the prolog/epilog insert pass, and allocate the stack
slot when spilling callee saved registers.

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

More information about the All-commits mailing list