1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00
Go to file
Bjorn Pettersson b45e047d7d [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
bindings [LLVM-C] [OCaml] Remove LLVMAddBBVectorizePass 2018-05-28 16:58:10 +00:00
cmake [cmake] Change WIN32 test to CMAKE_HOST_WIN32 2018-06-29 10:34:37 +00:00
docs nm: Add -no-weak flag for hiding weak symbols 2018-07-02 17:24:37 +00:00
examples [ORC] Update JITCompileCallbackManager to support multi-threaded code. 2018-05-30 01:57:45 +00:00
include [ADT] Disable the single callback optimization on Windows. 2018-07-03 08:19:10 +00:00
lib [DebugInfo] Corrections for salvageDebugInfo 2018-07-03 11:29:00 +00:00
projects [cmake] Support moving debuginfo-tests to llvm/projects 2017-12-12 17:06:08 +00:00
resources
runtimes Support for multiarch runtimes layout 2018-06-28 03:11:52 +00:00
test [DebugInfo] Corrections for salvageDebugInfo 2018-07-03 11:29:00 +00:00
tools [llvm-exegesis] Add an AArch64 target 2018-07-03 10:10:29 +00:00
unittests [llvm-exegesis] Adjust AArch64 unit test 2018-07-03 10:52:20 +00:00
utils [X86] Add phony registers for high halves of regs with low halves 2018-07-02 19:05:09 +00:00
.arcconfig [llvm] Set up .arcconfig to point to Diffusion L repository 2018-01-12 15:37:41 +00:00
.clang-format
.clang-tidy
.gitattributes [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
.gitignore gitignore: Ignore .vs folder (VS2017 config files) 2017-04-08 00:16:58 +00:00
CMakeLists.txt Support for multiarch runtimes layout 2018-06-28 03:11:52 +00:00
CODE_OWNERS.TXT CODE_OWNERS: Take ownership of the MIPS backend 2018-06-21 09:59:44 +00:00
configure
CREDITS.TXT Update my information in the CREDITS file. 2018-06-15 20:02:11 +00:00
LICENSE.TXT Update copyright year to 2018. 2018-06-18 12:22:17 +00:00
llvm.spec.in
LLVMBuild.txt
README.txt Test commit: remove a blank line 2018-06-08 21:21:55 +00:00
RELEASE_TESTERS.TXT Remove myself from the release testers list. (NFC) 2018-06-20 21:25:50 +00:00

The LLVM Compiler Infrastructure
================================

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

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.