From 66bc5c602aec3a8bfd826699847fc936f7aa9acd Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Mon, 25 Jul 2011 20:19:48 +0000 Subject: [PATCH] An initial description of the compact unwind encoding. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135955 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/CodeGenerator.html | 110 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 109 insertions(+), 1 deletion(-) diff --git a/docs/CodeGenerator.html b/docs/CodeGenerator.html index 44b835d8580..1d03cbdf1ac 100644 --- a/docs/CodeGenerator.html +++ b/docs/CodeGenerator.html @@ -1805,7 +1805,115 @@ $ llc -regalloc=pbqp file.bc -o pbqp.s;

Prolog/Epilog Code Insertion

-

To Be Written

+ + +

+ Compact Unwind +

+ +
+ +

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.

+ +

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 + where, and how to unwind out of the funciton. When the linker creates a final + linked image, it will create a __TEXT,__unwind_info + section. This section is a small and fast way for the runtime to access + unwind info for any given function. If we emit compact unwind info for the + function, that compact unwind info will be encoded in + the __TEXT,__unwind_info section. If we emit DWARF unwind info, + the __TEXT,__unwind_info section will contain the offset of the + FDE in the __TEXT,__eh_frame section in the final linked + image.

+ +

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

+ + + +
+

Late Machine Code Optimizations -- 2.34.1