llvm-project/llvm/lib
Petar Jovanovic 7b3a38ec30 [X86] Correct dwarf unwind information in function epilogue
CFI instructions that set appropriate cfa offset and cfa register are now
inserted in emitEpilogue() in X86FrameLowering.

Majority of the changes in this patch:

1. Ensure that CFI instructions do not affect code generation.
2. Enable maintaining correct information about cfa offset and cfa register
in a function when basic blocks are reordered, merged, split, duplicated.

These changes are target independent and described below.

Changed CFI instructions so that they:

1. are duplicable
2. are not counted as instructions when tail duplicating or tail merging
3. can be compared as equal

Add information to each MachineBasicBlock about cfa offset and cfa register
that are valid at its entry and exit (incoming and outgoing CFI info). Add
support for updating this information when basic blocks are merged, split,
duplicated, created. Add a verification pass (CFIInfoVerifier) that checks
that outgoing cfa offset and register of predecessor blocks match incoming
values of their successors.

Incoming and outgoing CFI information is used by a late pass
(CFIInstrInserter) that corrects CFA calculation rule for a basic block if
needed. That means that additional CFI instructions get inserted 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.

Patch by Violeta Vukobrat.

Differential Revision: https://reviews.llvm.org/D18046

llvm-svn: 306529
2017-06-28 10:21:17 +00:00
..
Analysis [ValueTracking] Enabling existing ValueTracking patch by default. 2017-06-28 10:08:08 +00:00
AsmParser Add dependency from AsmParser to BinaryFormat. 2017-06-07 04:24:33 +00:00
BinaryFormat Replace trivial use of external rc.exe by writing our own .res file. 2017-06-26 17:43:30 +00:00
Bitcode Add missing library dependency. 2017-06-28 00:05:27 +00:00
CodeGen [X86] Correct dwarf unwind information in function epilogue 2017-06-28 10:21:17 +00:00
DebugInfo Recommit "[ELF] - Add ability for DWARFContextInMemory to exit early when any error happen." 2017-06-28 08:21:19 +00:00
Demangle [ItaniumDemangle] Fix a exponential string copying bug 2017-05-28 23:24:52 +00:00
ExecutionEngine [ORC] Re-apply r306166 and r306168 with fix for regression test. 2017-06-23 23:25:28 +00:00
Fuzzer [libFuzzer] change the default max_len from 64 to 4096. This will affect cases where libFuzzer is run w/o initial corpus or with a corpus of very small items. 2017-06-15 22:43:40 +00:00
IR [Constants] Fix copy-pasto in llvm_unreachable message. NFC 2017-06-27 19:57:51 +00:00
IRReader Timer: Track name and description. 2016-11-18 19:43:18 +00:00
LTO [ThinLTO] Remove unnecessary include of Linker.h (NFC) 2017-06-22 16:18:48 +00:00
LineEditor
Linker Support for taking the max of module flags when linking, use for PIE/PIC 2017-05-23 00:08:00 +00:00
MC [WebAssembly] Add data size and alignement to linking section 2017-06-27 20:27:59 +00:00
Object [COFF, ARM64] Add support for Windows ARM64 COFF format 2017-06-27 23:58:19 +00:00
ObjectYAML [WebAssembly] Add data size and alignement to linking section 2017-06-27 20:27:59 +00:00
Option [GSoC] Flag value completion for clang 2017-06-20 16:31:31 +00:00
Passes [EarlyCSE][MemorySSA] Enable MemorySSA in function-simplification pass of EarlyCSE. 2017-06-27 22:25:02 +00:00
ProfileData [ProfData] Make the method threadsafe 2017-06-27 17:21:51 +00:00
Support Add support for Ananas platform 2017-06-25 08:19:37 +00:00
TableGen [BinaryFormat, Option, TableGen] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC). 2017-06-16 00:43:26 +00:00
Target [X86] Correct dwarf unwind information in function epilogue 2017-06-28 10:21:17 +00:00
Testing Mark LLVMTestingSupport as not installed in LLVMBuild. 2017-06-19 22:01:50 +00:00
ToolDrivers [GSoC] Flag value completion for clang 2017-06-20 16:31:31 +00:00
Transforms [InstCombine] Canonicalize clamp of float types to minmax in fast mode. 2017-06-28 09:26:20 +00:00
XRay Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
CMakeLists.txt [gtest] Create a shared include directory for gtest utilities. 2017-06-14 16:41:50 +00:00
LLVMBuild.txt [gtest] Create a shared include directory for gtest utilities. 2017-06-14 16:41:50 +00:00