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.)
This call to EpilogMap.clear() tripped me up in trying to understand the reasoning behind the rest of the changes in this patch. There are three cases here:
In the "Packed epilogue reusing the prologue" case, we clear EpilogMap; in the other cases, we don't.
Maybe the logic here could be a bit more explicit? Like maybe instead of clearing EpilogMap(), add checks in the caller in the two places it matters.