diff options
author | Petar Jovanovic <petar.jovanovic@imgtec.com> | 2017-11-01 16:04:11 +0000 |
---|---|---|
committer | Petar Jovanovic <petar.jovanovic@imgtec.com> | 2017-11-01 16:04:11 +0000 |
commit | f2faee92aaa5e3bd0f5a10704841442884f79263 (patch) | |
tree | 949923bb3f731c93d20ff0921ed2a5f8a20a2709 /llvm/lib/CodeGen/CMakeLists.txt | |
parent | e0d51846f294bd6ac130f1c8eb2b1b8c4994e90a (diff) | |
download | llvm-f2faee92aaa5e3bd0f5a10704841442884f79263.zip llvm-f2faee92aaa5e3bd0f5a10704841442884f79263.tar.gz llvm-f2faee92aaa5e3bd0f5a10704841442884f79263.tar.bz2 |
Correct dwarf unwind information in function epilogue for X86
This patch aims to provide correct dwarf unwind information in function
epilogue for X86.
It consists of two parts. The first part inserts CFI instructions that set
appropriate cfa offset and cfa register in emitEpilogue() in
X86FrameLowering. This part is X86 specific.
The second part is platform independent and ensures that:
- CFI instructions do not affect code generation
- Unwind information remains correct when a function is modified by
different passes. This is done in a late pass by analyzing information
about cfa offset and cfa register in BBs and inserting additional CFI
directives where necessary.
Changed CFI instructions so that they:
- are duplicable
- are not counted as instructions when tail duplicating or tail merging
- can be compared as equal
Added CFIInstrInserter pass:
- analyzes each basic block to determine cfa offset and register valid at
its entry and exit
- verifies that outgoing cfa offset and register of predecessor blocks match
incoming values of their successors
- inserts additional CFI directives at basic block beginning to correct the
rule for calculating CFA
Having CFI instructions in function epilogue can cause incorrect CFA
calculation rule for some basic blocks. This can happen if, due to basic
block reordering, or the existence of multiple epilogue blocks, some of the
blocks have wrong cfa offset and register values set by the epilogue block
above them.
CFIInstrInserter is currently run only on X86, but can be used by any target
that implements support for adding CFI instructions in epilogue.
Patch by Violeta Vukobrat.
Differential Revision: https://reviews.llvm.org/D35844
llvm-svn: 317100
Diffstat (limited to 'llvm/lib/CodeGen/CMakeLists.txt')
-rw-r--r-- | llvm/lib/CodeGen/CMakeLists.txt | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/CMakeLists.txt b/llvm/lib/CodeGen/CMakeLists.txt index 7ec7fda..44da41a 100644 --- a/llvm/lib/CodeGen/CMakeLists.txt +++ b/llvm/lib/CodeGen/CMakeLists.txt @@ -9,6 +9,7 @@ add_llvm_library(LLVMCodeGen BuiltinGCs.cpp CalcSpillWeights.cpp CallingConvLower.cpp + CFIInstrInserter.cpp CodeGen.cpp CodeGenPrepare.cpp CountingFunctionInserter.cpp |