Go to file
Bjorn Pettersson 8dd6cf711f [DebugInfo] Corrections for salvageDebugInfo
Summary:
When salvaging a dbg.declare/dbg.addr we should not add
DW_OP_stack_value to the DIExpression
(see test/Transforms/InstCombine/salvage-dbg-declare.ll).

Consider this example
  %vla = alloca i32, i64 2
  call void @llvm.dbg.declare(metadata i32* %vla, metadata !1, metadata !DIExpression())

Instcombine will turn it into
  %vla1 = alloca [2 x i32]
  %vla1.sub = getelementptr inbounds [2 x i32], [2 x i32]* %vla, i64 0, i64 0
  call void @llvm.dbg.declare(metadata [2 x i32]* %vla1.sub, metadata !19, metadata !DIExpression())

If the GEP can be eliminated, then the dbg.declare will be salvaged
and we should get
  %vla1 = alloca [2 x i32]
  call void @llvm.dbg.declare(metadata [2 x i32]* %vla1, metadata !19, metadata !DIExpression())

The problem was that salvageDebugInfo did not recognize dbg.declare
as being indirect (%vla1 points to the value, it does not hold the
value), so we incorrectly got
  call void @llvm.dbg.declare(metadata [2 x i32]* %vla1, metadata !19, metadata !DIExpression(DW_OP_stack_value))

I also made sure that llvm::salvageDebugInfo and
DIExpression::prependOpcodes do not add DW_OP_stack_value to
the DIExpression in case no new operands are added to the
DIExpression. That way we avoid to, unneccessarily, turn a
register location expression into an implicit location expression
in some situations (see test11 in test/Transforms/LICM/sinking.ll).

Reviewers: aprantl, vsk

Reviewed By: aprantl, vsk

Subscribers: JDevlieghere, llvm-commits

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

llvm-svn: 336191
2018-07-03 11:29:00 +00:00
clang Revert r336021 "PR33924: merge local declarations that have linkage of some kind within" 2018-07-03 07:51:41 +00:00
clang-tools-extra [clangd] Incorporate transitive #includes into code complete proximity scoring. 2018-07-03 08:09:29 +00:00
compiler-rt [scudo] Enable Scudo memory hooks for Fuchsia. 2018-07-02 19:48:01 +00:00
debuginfo-tests [debuginfo-tests] Always use the system python to invoke llgdb.py. 2018-06-10 19:38:26 +00:00
libclc atom: Use volatile pointers for cl_khr_{global,local}_int32_{base,extended}_atomics 2018-06-21 19:27:39 +00:00
libcxx [libc++] Install the missing header __errc 2018-07-03 04:01:44 +00:00
libcxxabi Revert r336159, r336157. Some bots failed on qualified std::max_align_t, and other on unqualified max_align_t. 2018-07-03 01:30:53 +00:00
libunwind Introduce a separate preprocessor macro, _LIBUNWIND_USE_DLADDR, for directly controlling a dependency on dladdr(). This will allow us to use libunwind without adding a libdl dependency. 2018-06-29 20:41:50 +00:00
lld [ELF] Don't create empty output section for unreferenced PROVIDEs 2018-07-03 09:23:25 +00:00
lldb Re-sort the lldb.xcodeproj project file and commit the script 2018-07-03 00:43:57 +00:00
llgo Update copyright year to 2018. 2018-06-18 12:22:17 +00:00
llvm [DebugInfo] Corrections for salvageDebugInfo 2018-07-03 11:29:00 +00:00
openmp [OMPT] Use alloca() to force availability of frame pointer 2018-07-02 09:13:38 +00:00
parallel-libs Update copyright year to 2018. 2018-06-18 12:22:17 +00:00
polly Fix for r336080: Missing colon in REQUIRES line 2018-07-02 08:36:49 +00:00
README.md

README.md

Low Level Virtual Machine (LLVM)

This directory and its subdirectories contain source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and runtime environments.