[PATCH] D87448: [CodeGen] [WinException] Only produce handler data at the end of the function if needed

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 16 04:11:10 PST 2020


mstorsjo updated this revision to Diff 305467.
mstorsjo edited the summary of this revision.
mstorsjo added a reviewer: hans.
mstorsjo added a comment.

Updated for a retry, trying to retain the exact section ordering as before, to hopefully avoid the LLD ICF runtime explosion reported before.

This reapplies 36c64af9d7f97414d48681b74352c9684077259b <https://reviews.llvm.org/rG36c64af9d7f97414d48681b74352c9684077259b> in updated form, applying @rnk's earlier suggestion, emitting .xdata at .seh_endproc.

This keeps the exact same output header order for most code generated by the LLVM CodeGen layer. (Sections still change order for code built from assembly where functions lack an explicit .seh_handlerdata directive, and functions with chained unwind info.)

The practical effect should be that assembly output lacks superfluous ".seh_handlerdata; .text" pairs at the end of functions that don't handle exceptions, which allows such functions to use the AArch64 packed unwind format again.

@hans - Can you check whether this works fine with libfuzzer and LLD's ICF?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87448/new/

https://reviews.llvm.org/D87448

Files:
  llvm/include/llvm/MC/MCStreamer.h
  llvm/include/llvm/MC/MCWin64EH.h
  llvm/include/llvm/MC/MCWinEH.h
  llvm/lib/CodeGen/AsmPrinter/WinException.cpp
  llvm/lib/MC/MCStreamer.cpp
  llvm/lib/MC/MCWin64EH.cpp
  llvm/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFStreamer.cpp
  llvm/lib/Target/X86/MCTargetDesc/X86WinCOFFStreamer.cpp
  llvm/test/CodeGen/AArch64/win64-jumptable.ll
  llvm/test/CodeGen/AArch64/wineh1.mir
  llvm/test/CodeGen/X86/avx512-intel-ocl.ll
  llvm/test/CodeGen/X86/avx512-regcall-Mask.ll
  llvm/test/CodeGen/X86/avx512-regcall-NoMask.ll
  llvm/test/CodeGen/X86/break-false-dep.ll
  llvm/test/CodeGen/X86/conditional-tailcall-pgso.ll
  llvm/test/CodeGen/X86/conditional-tailcall.ll
  llvm/test/CodeGen/X86/gnu-seh-nolpads.ll
  llvm/test/CodeGen/X86/mixed-ptr-sizes.ll
  llvm/test/CodeGen/X86/musttail-varargs.ll
  llvm/test/CodeGen/X86/no-sse-win64.ll
  llvm/test/CodeGen/X86/win64-jumptable.ll
  llvm/test/CodeGen/X86/win64_frame.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87448.305467.patch
Type: text/x-patch
Size: 27754 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201116/053ca737/attachment-0001.bin>


More information about the llvm-commits mailing list