llvm-project/llvm/lib/CodeGen/AsmPrinter
Adrian Prantl 274bcbc139 Improve the accuracy of variable ranges .debug_loc location lists.
For the following motivating example
  bool c();
  void f();
  bool start() {
    bool result = c();
    if (!c()) {
      result = false;
      goto exit;
    }
    f();
    result = true;
  exit:
    return result;
  }

we would previously generate a single DW_AT_const_value(1) because
only the DBG_VALUE in the second-to-last basic block survived
codegen. This patch improves the heuristic used to determine when a
DBG_VALUE is available at the beginning of its variable's enclosing
lexical scope:

- Stop giving singular constants blanket permission to take over the
  entire scope. There is still a special case for constants in the
  function prologue that we also miight want to retire later.

- Use the lexical scope information to determine available-at-entry
  instead of proximity to the function prologue.

After this patch we generate a location list with a more accurate
narrower availability for the constant true value. As a pleasant side
effect, we also generate inline locations instead of location lists
where a loacation covers the entire range of the enclosing lexical
scope.

Measured on compiling llc with four targets this doesn't have an
effect on compile time and reduces the size of the debug info for llc
by ~600K.

rdar://problem/30286912

llvm-svn: 305599
2017-06-16 22:40:04 +00:00
..
ARMException.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
AddressPool.cpp Move helpers into anonymous namespaces. NFC. 2016-08-06 11:13:10 +00:00
AddressPool.h
AsmPrinter.cpp IR: Replace the "Linker Options" module flag with "llvm.linker.options" named metadata. 2017-06-12 20:10:48 +00:00
AsmPrinterDwarf.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
AsmPrinterHandler.h
AsmPrinterInlineAsm.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
ByteStreamer.h [NFC] Header cleanup 2016-04-18 09:17:29 +00:00
CMakeLists.txt [CMake] NFC. Updating CMake dependency specifications 2016-11-17 04:36:50 +00:00
CodeViewDebug.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
CodeViewDebug.h [CodeGen] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC). 2017-06-06 22:22:41 +00:00
DIE.cpp Avoid using relocations for ref_addr in .dwo files 2017-04-22 07:53:44 +00:00
DIEHash.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
DIEHash.h DebugInfo: Include .dwo file name when hashing multiple CUs in a single file 2017-05-29 06:32:34 +00:00
DIEHashAttributes.def Fix DIEHash refactoring that dropped the DW_AT_name from the hash 2017-05-23 18:36:07 +00:00
DbgValueHistoryCalculator.cpp DbgValueHistoryCalculator: Ignore call instructions that claim to clobber SP. 2017-06-01 21:14:58 +00:00
DbgValueHistoryCalculator.h
DebugHandlerBase.cpp Make helper functions static. NFC. 2017-05-26 20:09:00 +00:00
DebugHandlerBase.h Refactor DebugHandlerBase a bit to common non-debug-having-function filtering 2017-02-16 18:48:33 +00:00
DebugLocEntry.h Use print() instead of dump() in code 2017-01-28 06:53:55 +00:00
DebugLocStream.cpp
DebugLocStream.h Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
DwarfAccelTable.cpp This change removes the dependency on DwarfDebug that was used for DW_FORM_ref_addr by making a new DIEUnit class in DIE.cpp. 2016-12-01 18:56:29 +00:00
DwarfAccelTable.h Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
DwarfCFIException.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
DwarfCompileUnit.cpp Align definition of DW_OP_plus with DWARF spec [3/3] 2017-06-14 13:14:38 +00:00
DwarfCompileUnit.h Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
DwarfDebug.cpp Improve the accuracy of variable ranges .debug_loc location lists. 2017-06-16 22:40:04 +00:00
DwarfDebug.h Fix an assertion failure when duplicate dbg.declares are present. 2017-06-12 22:41:06 +00:00
DwarfException.h Emit .cfi_sections before the first .cfi_startproc 2017-01-02 18:05:27 +00:00
DwarfExpression.cpp Align definition of DW_OP_plus with DWARF spec [3/3] 2017-06-14 13:14:38 +00:00
DwarfExpression.h Align definition of DW_OP_plus with DWARF spec [3/3] 2017-06-14 13:14:38 +00:00
DwarfFile.cpp Make a DWARF generator so we can unit test DWARF APIs with gtest. 2016-12-08 01:03:48 +00:00
DwarfFile.h DWARF: Avoid cross-CU references under Fission 2017-05-12 01:13:45 +00:00
DwarfStringPool.cpp
DwarfStringPool.h
DwarfUnit.cpp Align definition of DW_OP_plus with DWARF spec [3/3] 2017-06-14 13:14:38 +00:00
DwarfUnit.h DWARF: Avoid cross-CU references under Fission 2017-05-12 01:13:45 +00:00
EHStreamer.cpp [EH] Fix the LSDA that we emit for unknown EH personalities 2017-05-31 22:18:49 +00:00
EHStreamer.h
ErlangGCPrinter.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
LLVMBuild.txt Update libdeps to add BinaryFormat, introduced in r304864. 2017-06-07 04:48:49 +00:00
OcamlGCPrinter.cpp [CodeGen] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC). 2017-06-07 23:53:32 +00:00
WinException.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
WinException.h [WinEH] Don't assume endFunction is called while in .text 2016-12-28 19:05:12 +00:00