OSDN Git Service

[DebugInfo][X86] Improve X86 Optimize LEAs handling of debug values.
authorAndrew Ng <anng.sw@gmail.com>
Fri, 28 Apr 2017 08:44:30 +0000 (08:44 +0000)
committerAndrew Ng <anng.sw@gmail.com>
Fri, 28 Apr 2017 08:44:30 +0000 (08:44 +0000)
commit9d0dc96310eaedbf6a3ccc73e612685f1b950871
tree514bd3146d748f432de909f94fe9abcf99a6b42c
parent0542dc78c120f5e3ef58f23fa42b176714ad0e73
[DebugInfo][X86] Improve X86 Optimize LEAs handling of debug values.

This is a follow up to the fix in r298360 to improve the handling of debug
values when redundant LEAs are removed. The fix in r298360 effectively
discarded the debug values. This patch now attempts to preserve the debug
values by using the DWARF DW_OP_stack_value operation via prependDIExpr.

Moved functions appendOffset and prependDIExpr from Local.cpp to
DebugInfoMetadata.cpp and made them available as static member functions of
DIExpression.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301630 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/DebugInfoMetadata.h
lib/IR/DebugInfoMetadata.cpp
lib/Target/X86/X86OptimizeLEAs.cpp
lib/Transforms/Utils/Local.cpp
test/CodeGen/X86/lea-opt-with-debug.mir