[all-commits] [llvm/llvm-project] 58de1e: Fix stack layout for frames larger than 2gb (#84114)

Wesley Wiser via All-commits all-commits at lists.llvm.org
Wed Mar 27 08:06:19 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 58de1e2c5eee548a9b365e3b1554d87317072ad9
      https://github.com/llvm/llvm-project/commit/58de1e2c5eee548a9b365e3b1554d87317072ad9
  Author: Wesley Wiser <wwiser at gmail.com>
  Date:   2024-03-27 (Wed, 27 Mar 2024)

  Changed paths:
    M llvm/include/llvm/CodeGen/MachineFrameInfo.h
    M llvm/include/llvm/CodeGen/TargetFrameLowering.h
    M llvm/include/llvm/MC/MCAsmBackend.h
    M llvm/include/llvm/MC/MCDwarf.h
    M llvm/lib/CodeGen/CFIInstrInserter.cpp
    M llvm/lib/CodeGen/MachineFrameInfo.cpp
    M llvm/lib/CodeGen/PrologEpilogInserter.cpp
    M llvm/lib/MC/MCDwarf.cpp
    M llvm/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp
    M llvm/lib/Target/ARM/ARMFrameLowering.cpp
    M llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
    M llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackendDarwin.h
    M llvm/lib/Target/Hexagon/HexagonFrameLowering.cpp
    M llvm/lib/Target/MSP430/MSP430FrameLowering.cpp
    M llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
    M llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp
    M llvm/lib/Target/X86/X86FrameLowering.cpp
    M llvm/lib/Target/X86/X86FrameLowering.h
    M llvm/lib/Target/X86/X86RegisterInfo.cpp
    M llvm/test/CodeGen/PowerPC/huge-frame-size.ll
    A llvm/test/CodeGen/X86/huge-stack.ll

  Log Message:
  -----------
  Fix stack layout for frames larger than 2gb (#84114)

For very large stack frames, the offset from the stack pointer to a local can be more than 2^31 which overflows various `int` offsets in the frame lowering code.

This patch updates the frame lowering code to calculate the offsets as 64-bit values and resolves the overflows, resulting in the correct codegen for very large frames.

Fixes #48911



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list