MachineModuleInfo: Remove UsesMorestackAddr
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Sun, 17 Apr 2022 19:45:20 +0000 (15:45 -0400)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 20 Apr 2022 15:10:20 +0000 (11:10 -0400)
commit3659780d58722ea38adf25f7116151f2ecf2d521
treef6140f0ee820eb422903bf9bccf5a10b638422ad
parentfb3b3f76bf75875684eedfe0711424e7ceba4b41
MachineModuleInfo: Remove UsesMorestackAddr

This is x86 specific, and adds statefulness to
MachineModuleInfo. Instead of explicitly tracking this, infer if we
need to declare the symbol based on the reference previously inserted.

This produces a small change in the output due to the move from
AsmPrinter::doFinalization to X86's emitEndOfAsmFile. This will now be
moved relative to other end of file fields, which I'm assuming doesn't
matter (e.g. the __morestack_addr declaration is now after the
.note.GNU-split-stack part)

This also produces another small change in code if the module happened
to define/declare __morestack_addr, but I assume that's invalid and
doesn't really matter.
llvm/include/llvm/CodeGen/MachineModuleInfo.h
llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
llvm/lib/CodeGen/MachineModuleInfo.cpp
llvm/lib/Target/X86/X86AsmPrinter.cpp
llvm/lib/Target/X86/X86FrameLowering.cpp
llvm/test/CodeGen/X86/morestack-decl.ll [new file with mode: 0644]
llvm/test/CodeGen/X86/segmented-stacks.ll