From 75471d698fe35d42ea230019e7c7761afead74a4 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Tue, 26 Jul 2011 07:58:09 +0000 Subject: [PATCH] Describe the reasoning for compact unwind in better terms. Thanks to Nick Kledzik for the description. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136064 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/CodeGenerator.html | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/docs/CodeGenerator.html b/docs/CodeGenerator.html index aba7b1bcf5d..53c2b54d36a 100644 --- a/docs/CodeGenerator.html +++ b/docs/CodeGenerator.html @@ -1813,12 +1813,14 @@ $ llc -regalloc=pbqp file.bc -o pbqp.s;
-

Unwinding out of a function is done virually via DWARF encodings. These - encodings exist in two forms: a Common Information Entry (CIE) and a Frame - Description Entry (FDE). These two tables contain the information necessary - for the unwinder to restore the state of the computer to before the function - was called. However, the tables themselves are rather large. LLVM can use a - "compact unwind" encoding to represent the virtual unwinding.

+

Throwing an exception requires unwinding out of a function. The + information on how to unwind a given function is traditionally expressed in + DWARF unwind (a.k.a. frame) info. But that format was originally developed + for debuggers to backtrace, and each Frame Description Entry (FDE) requires + ~20-30 bytes per function. There is also the cost of mapping from an address + in a function to the corresponding FDE at runtime. An alternative unwind + encoding is called compact unwind and requires just 4-bytes per + function.

The compact unwind encoding is a 32-bit value, which is encoded in an architecture-specific way. It specifies which registers to restore and from @@ -1834,7 +1836,7 @@ $ llc -regalloc=pbqp file.bc -o pbqp.s;

For X86, there are three modes for the compact unwind encoding:

-