1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-23 21:13:02 +02:00
llvm-mirror/test
Adrian Prantl 95bcf12f18 Salvage debug info from instructions about to be deleted
[Reapplies r297971 and punting on finding a better API for findDbgValues()]

This patch improves debug info quality in InstCombine by looking at
values that are about to be deleted, checking whether there are any
dbg.value instrinsics referring to them, and potentially encoding the
semantics of the deleted instruction into the dbg.value's
DIExpression.

In the example in the testcase (which was extracted from XNU) there is a sequence of

 %4 = load %struct.entry*, %struct.entry** %next2, align 8, !dbg !41
 %5 = bitcast %struct.entry* %4 to i8*, !dbg !42
 %add.ptr4 = getelementptr inbounds i8, i8* %5, i64 -8, !dbg !43
 %6 = bitcast i8* %add.ptr4 to %struct.entry*, !dbg !44
 call void @llvm.dbg.value(metadata %struct.entry* %6, i64 0, metadata !20, metadata !21), !dbg 34

When these instructions are eliminated by instcombine one after
another, we can still salvage the otherwise dead debug info:

- Bitcasts have no effect, so have the dbg.value point to operand(0)
- Loads can be expressed via a DW_OP_deref
- Constant gep instructions can be replaced by DWARF expression arithmetic

The API introduced by this patch is not specific to instcombine and
can be useful in other places, too.

rdar://problem/30725338

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

llvm-svn: 297994
2017-03-16 21:14:09 +00:00
..
Analysis [SCEV] Compute affine range in another way to avoid bitwidth extending. 2017-03-16 21:07:38 +00:00
Assembler [DebugInfo] Emit address space with DW_AT_address_class attribute for pointer and reference types 2017-03-08 23:55:44 +00:00
Bindings
Bitcode [DebugInfo] Emit address space with DW_AT_address_class attribute for pointer and reference types 2017-03-08 23:55:44 +00:00
BugPoint
CodeGen [globalisel] Correct one more simple immediate that should be a ConstantInt. 2017-03-16 19:59:19 +00:00
DebugInfo [PDB] Add support for parsing Flags from PDB Stream. 2017-03-16 20:19:11 +00:00
Examples
ExecutionEngine
Feature Disable gvn-hoist (PR32153) 2017-03-06 21:10:40 +00:00
FileCheck [FileCheck] Added --enable-var-scope option to enable scope for regex variables. 2017-03-09 17:59:04 +00:00
Instrumentation Revert "[PGO] Value profile for size of memory intrinsic calls" 2017-03-16 13:16:35 +00:00
Integer
JitListener
LibDriver
Linker [Linker] Provide callback for internalization 2017-03-13 18:08:11 +00:00
LTO Perform symbol binding for .symver versioned symbols 2017-03-09 00:19:49 +00:00
MC [Hexagon] Fixing test from 297920 to add Hexagon triple. 2017-03-16 01:52:10 +00:00
Object Archives require a symbol table on Solaris, even if empty. 2017-03-14 19:57:13 +00:00
ObjectYAML [ObjectYAML] Fix issue with DWARF2 AddrSize 8 2017-03-07 21:34:35 +00:00
Other Bring back r297624. 2017-03-13 20:00:25 +00:00
SymbolRewriter
TableGen [globalisel][tblgen] Add support for ComplexPatterns 2017-03-14 21:32:08 +00:00
ThinLTO/X86 LTO: Hash type identifier resolutions for WholeProgramDevirt. 2017-03-10 21:37:10 +00:00
tools [llvm-config] Add minimal sanity tests for path options 2017-03-15 05:57:29 +00:00
Transforms Salvage debug info from instructions about to be deleted 2017-03-16 21:14:09 +00:00
Unit
Verifier [DebugInfo] Emit address space with DW_AT_address_class attribute for pointer and reference types 2017-03-08 23:55:44 +00:00
YAMLParser
.clang-format
CMakeLists.txt
lit.cfg
lit.site.cfg.in
TestRunner.sh