[MC] [Win64EH] Try writing an ARM64 "packed epilog" even if the epilog doesn't share...
authorMartin Storsjö <martin@martin.st>
Fri, 13 May 2022 07:42:56 +0000 (10:42 +0300)
committerMartin Storsjö <martin@martin.st>
Mon, 16 May 2022 21:41:39 +0000 (00:41 +0300)
commitcabefea2ec99f80ecdf9d3d5fe955831532ff4b0
treee70e33ea274eb0cc3e8495e20be9b22328057cd7
parent68f37e7991bf41a6f3fb3dd12d0e7a42822de347
[MC] [Win64EH] Try writing an ARM64 "packed epilog" even if the epilog doesn't share opcodes with the prolog

The "packed epilog" form only implies that the epilog is located
exactly at the end of the function (so the location of the epilog
is implicit from the epilog opcodes), but it doesn't have to share
opcodes with the prolog - as long as the total number of opcode
bytes and the offset to the epilog fit within the bitfields.

This avoids writing a 4 byte epilog scope in many cases. (I haven't
measured how much this shrinks actual xdata sections in practice
though.)

Differential Revision: https://reviews.llvm.org/D125536
llvm/lib/MC/MCWin64EH.cpp
llvm/test/CodeGen/AArch64/wineh1.mir
llvm/test/CodeGen/AArch64/wineh2.mir
llvm/test/CodeGen/AArch64/wineh5.mir
llvm/test/MC/AArch64/seh-optimize.s
llvm/test/MC/AArch64/seh-packed-epilog.s