1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
llvm-mirror/include/llvm/Target
Petar Jovanovic d61746acde 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
2017-11-01 16:04:11 +00:00
..
GlobalISel [globalisel][tablegen] Map ld and st to G_LOAD and G_STORE. NFC 2017-10-15 02:41:12 +00:00
CostTable.h [modules] Add missing include. 2016-08-19 08:30:42 +00:00
GenericOpcodes.td [GlobalISel] Update the documentation and comment for G_[UN]MERGE_VALUES 2017-09-25 22:03:06 +00:00
Target.td Correct dwarf unwind information in function epilogue for X86 2017-11-01 16:04:11 +00:00
TargetCallingConv.h Elide argument copies during instruction selection 2017-03-01 21:42:00 +00:00
TargetCallingConv.td Swift Calling Convention: add swifterror attribute. 2016-04-01 21:41:15 +00:00
TargetFrameLowering.h Correct dwarf unwind information in function epilogue for X86 2017-11-01 16:04:11 +00:00
TargetInstrInfo.h [MachineOutliner] Disable outlining from LinkOnceODRs by default 2017-10-07 00:16:34 +00:00
TargetIntrinsicInfo.h GlobalISel: support translation of intrinsic calls. 2016-07-29 22:32:36 +00:00
TargetItinerary.td Fix comment typos. NFC. 2016-11-20 13:47:59 +00:00
TargetLowering.h DAG: Add opcode and source type to isFPExtFree 2017-10-13 19:55:45 +00:00
TargetLoweringObjectFile.h [WebAssembly] Remove flags from MCSectionWasm 2017-09-12 18:31:24 +00:00
TargetMachine.h Revert "TargetMachine: Merge TargetMachine and LLVMTargetMachine" 2017-10-12 22:57:28 +00:00
TargetOpcodes.def [globalisel] Add a G_BSWAP instruction and support bswap using it. 2017-09-19 14:25:15 +00:00
TargetOpcodes.h TargetOpcodes.h: Don't mark header functions as file local 2017-10-24 21:29:19 +00:00
TargetOptions.h sink DebugCompressionType into MC for exposing to clang 2017-06-09 00:40:19 +00:00
TargetRegisterInfo.h [SystemZ] implement shouldCoalesce() 2017-09-29 14:31:39 +00:00
TargetSchedule.td Fix comment typos. 2017-05-08 15:33:08 +00:00
TargetSelectionDAG.td [tablegen] Handle common load/store predicates inside tablegen. NFC. 2017-10-15 02:06:44 +00:00
TargetSubtargetInfo.h Add logic to greedy reg alloc to avoid bad eviction chains 2017-10-22 17:59:38 +00:00