2014-06-14 06:18:23 +08:00
|
|
|
; RUN: llc -O0 -mtriple=x86_64-apple-darwin < %s -filetype=obj \
|
|
|
|
; RUN: | llvm-dwarfdump -debug-dump=info - \
|
|
|
|
; RUN: | FileCheck %s -check-prefix=CHECK -check-prefix=DWARF4
|
|
|
|
; RUN: llc -O0 -mtriple=x86_64-apple-darwin < %s -filetype=obj -dwarf-version=3 \
|
|
|
|
; RUN: | llvm-dwarfdump -debug-dump=info - \
|
|
|
|
; RUN: | FileCheck %s -check-prefix=CHECK -check-prefix=DWARF3
|
2012-05-09 02:56:00 +08:00
|
|
|
|
|
|
|
; FIXME: The location here needs to be fixed, but llvm-dwarfdump doesn't handle
|
|
|
|
; DW_AT_location lists yet.
|
2014-06-14 06:18:23 +08:00
|
|
|
; DWARF4: DW_AT_location [DW_FORM_sec_offset] (0x00000000)
|
2013-07-10 04:28:37 +08:00
|
|
|
|
2013-11-22 07:46:41 +08:00
|
|
|
; FIXME: The location here needs to be fixed, but llvm-dwarfdump doesn't handle
|
|
|
|
; DW_AT_location lists yet.
|
|
|
|
; DWARF3: DW_AT_location [DW_FORM_data4] (0x00000000)
|
|
|
|
|
2014-06-14 06:18:23 +08:00
|
|
|
; CHECK-NOT: DW_TAG
|
|
|
|
; CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000067] = "vla")
|
|
|
|
|
2013-07-10 04:28:37 +08:00
|
|
|
; Unfortunately llvm-dwarfdump can't unparse a list of DW_AT_locations
|
|
|
|
; right now, so we check the asm output:
|
|
|
|
; RUN: llc -O0 -mtriple=x86_64-apple-darwin %s -o - -filetype=asm | FileCheck %s -check-prefix=ASM-CHECK
|
|
|
|
; vla should have a register-indirect address at one point.
|
Clean up the processing of dbg.value in various places
Summary:
First up is instcombine, where in the dbg.declare -> dbg.value conversion,
the llvm.dbg.value needs to be called on the actual loaded value, rather
than the address (since the whole point of this transformation is to be
able to get rid of the alloca). Further, now that that's cleaned up, we
can remove a hack in the backend, that would add an implicit OP_deref if
the argument to dbg.value was an alloca. This stems from before the
existence of DIExpression and is no longer necessary since the deref can
be expressed explicitly.
Now, in order to make sure that the tests pass with this change, we need to
correct the printing of DEBUG_VALUE comments to take into account the
expression, which wasn't taken into account before.
Unfortunately, for both these changes, there were a number of incorrect
test cases (mostly the wrong number of DW_OP_derefs, but also a couple
where the test itself was broken more badly). aprantl and I have gone
through and adjusted these test case in order to make them pass with
these fixes and in some cases to make sure they're actually testing
what they are meant to test.
Reviewers: aprantl
Subscribers: dsanders
Differential Revision: http://reviews.llvm.org/D14186
llvm-svn: 256077
2015-12-19 10:02:44 +08:00
|
|
|
; ASM-CHECK: DEBUG_VALUE: vla <- [%RCX+0]
|
2013-09-19 06:08:59 +08:00
|
|
|
; ASM-CHECK: DW_OP_breg2
|
2012-05-09 02:56:00 +08:00
|
|
|
|
2014-12-06 02:19:38 +08:00
|
|
|
; RUN: llvm-as %s -o - | llvm-dis - | FileCheck %s --check-prefix=PRETTY-PRINT
|
Clean up the processing of dbg.value in various places
Summary:
First up is instcombine, where in the dbg.declare -> dbg.value conversion,
the llvm.dbg.value needs to be called on the actual loaded value, rather
than the address (since the whole point of this transformation is to be
able to get rid of the alloca). Further, now that that's cleaned up, we
can remove a hack in the backend, that would add an implicit OP_deref if
the argument to dbg.value was an alloca. This stems from before the
existence of DIExpression and is no longer necessary since the deref can
be expressed explicitly.
Now, in order to make sure that the tests pass with this change, we need to
correct the printing of DEBUG_VALUE comments to take into account the
expression, which wasn't taken into account before.
Unfortunately, for both these changes, there were a number of incorrect
test cases (mostly the wrong number of DW_OP_derefs, but also a couple
where the test itself was broken more badly). aprantl and I have gone
through and adjusted these test case in order to make them pass with
these fixes and in some cases to make sure they're actually testing
what they are meant to test.
Reviewers: aprantl
Subscribers: dsanders
Differential Revision: http://reviews.llvm.org/D14186
llvm-svn: 256077
2015-12-19 10:02:44 +08:00
|
|
|
; PRETTY-PRINT: DIExpression(DW_OP_deref)
|
2014-12-06 02:19:38 +08:00
|
|
|
|
2015-11-06 06:03:56 +08:00
|
|
|
define void @testVLAwithSize(i32 %s) nounwind uwtable ssp !dbg !5 {
|
2012-05-09 02:56:00 +08:00
|
|
|
entry:
|
|
|
|
%s.addr = alloca i32, align 4
|
|
|
|
%saved_stack = alloca i8*
|
|
|
|
%i = alloca i32, align 4
|
|
|
|
store i32 %s, i32* %s.addr, align 4
|
2015-04-30 00:38:44 +08:00
|
|
|
call void @llvm.dbg.declare(metadata i32* %s.addr, metadata !10, metadata !DIExpression()), !dbg !11
|
2015-02-28 05:17:42 +08:00
|
|
|
%0 = load i32, i32* %s.addr, align 4, !dbg !12
|
2012-05-09 02:56:00 +08:00
|
|
|
%1 = zext i32 %0 to i64, !dbg !12
|
|
|
|
%2 = call i8* @llvm.stacksave(), !dbg !12
|
|
|
|
store i8* %2, i8** %saved_stack, !dbg !12
|
|
|
|
%vla = alloca i32, i64 %1, align 16, !dbg !12
|
IR: Make metadata typeless in assembly
Now that `Metadata` is typeless, reflect that in the assembly. These
are the matching assembly changes for the metadata/value split in
r223802.
- Only use the `metadata` type when referencing metadata from a call
intrinsic -- i.e., only when it's used as a `Value`.
- Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
when referencing it from call intrinsics.
So, assembly like this:
define @foo(i32 %v) {
call void @llvm.foo(metadata !{i32 %v}, metadata !0)
call void @llvm.foo(metadata !{i32 7}, metadata !0)
call void @llvm.foo(metadata !1, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{metadata !3}, metadata !0)
ret void, !bar !2
}
!0 = metadata !{metadata !2}
!1 = metadata !{i32* @global}
!2 = metadata !{metadata !3}
!3 = metadata !{}
turns into this:
define @foo(i32 %v) {
call void @llvm.foo(metadata i32 %v, metadata !0)
call void @llvm.foo(metadata i32 7, metadata !0)
call void @llvm.foo(metadata i32* @global, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{!3}, metadata !0)
ret void, !bar !2
}
!0 = !{!2}
!1 = !{i32* @global}
!2 = !{!3}
!3 = !{}
I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines). I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.
This is part of PR21532.
llvm-svn: 224257
2014-12-16 03:07:53 +08:00
|
|
|
call void @llvm.dbg.declare(metadata i32* %vla, metadata !14, metadata !30), !dbg !18
|
2015-04-30 00:38:44 +08:00
|
|
|
call void @llvm.dbg.declare(metadata i32* %i, metadata !19, metadata !DIExpression()), !dbg !20
|
2012-05-09 02:56:00 +08:00
|
|
|
store i32 0, i32* %i, align 4, !dbg !21
|
|
|
|
br label %for.cond, !dbg !21
|
|
|
|
|
|
|
|
for.cond: ; preds = %for.inc, %entry
|
2015-02-28 05:17:42 +08:00
|
|
|
%3 = load i32, i32* %i, align 4, !dbg !21
|
|
|
|
%4 = load i32, i32* %s.addr, align 4, !dbg !21
|
2012-05-09 02:56:00 +08:00
|
|
|
%cmp = icmp slt i32 %3, %4, !dbg !21
|
|
|
|
br i1 %cmp, label %for.body, label %for.end, !dbg !21
|
|
|
|
|
|
|
|
for.body: ; preds = %for.cond
|
2015-02-28 05:17:42 +08:00
|
|
|
%5 = load i32, i32* %i, align 4, !dbg !23
|
|
|
|
%6 = load i32, i32* %i, align 4, !dbg !23
|
2012-05-09 02:56:00 +08:00
|
|
|
%mul = mul nsw i32 %5, %6, !dbg !23
|
2015-02-28 05:17:42 +08:00
|
|
|
%7 = load i32, i32* %i, align 4, !dbg !23
|
2012-05-09 02:56:00 +08:00
|
|
|
%idxprom = sext i32 %7 to i64, !dbg !23
|
[opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction
One of several parallel first steps to remove the target type of pointers,
replacing them with a single opaque pointer type.
This adds an explicit type parameter to the gep instruction so that when the
first parameter becomes an opaque pointer type, the type to gep through is
still available to the instructions.
* This doesn't modify gep operators, only instructions (operators will be
handled separately)
* Textual IR changes only. Bitcode (including upgrade) and changing the
in-memory representation will be in separate changes.
* geps of vectors are transformed as:
getelementptr <4 x float*> %x, ...
->getelementptr float, <4 x float*> %x, ...
Then, once the opaque pointer type is introduced, this will ultimately look
like:
getelementptr float, <4 x ptr> %x
with the unambiguous interpretation that it is a vector of pointers to float.
* address spaces remain on the pointer, not the type:
getelementptr float addrspace(1)* %x
->getelementptr float, float addrspace(1)* %x
Then, eventually:
getelementptr float, ptr addrspace(1) %x
Importantly, the massive amount of test case churn has been automated by
same crappy python code. I had to manually update a few test cases that
wouldn't fit the script's model (r228970,r229196,r229197,r229198). The
python script just massages stdin and writes the result to stdout, I
then wrapped that in a shell script to handle replacing files, then
using the usual find+xargs to migrate all the files.
update.py:
import fileinput
import sys
import re
ibrep = re.compile(r"(^.*?[^%\w]getelementptr inbounds )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")
normrep = re.compile( r"(^.*?[^%\w]getelementptr )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")
def conv(match, line):
if not match:
return line
line = match.groups()[0]
if len(match.groups()[5]) == 0:
line += match.groups()[2]
line += match.groups()[3]
line += ", "
line += match.groups()[1]
line += "\n"
return line
for line in sys.stdin:
if line.find("getelementptr ") == line.find("getelementptr inbounds"):
if line.find("getelementptr inbounds") != line.find("getelementptr inbounds ("):
line = conv(re.match(ibrep, line), line)
elif line.find("getelementptr ") != line.find("getelementptr ("):
line = conv(re.match(normrep, line), line)
sys.stdout.write(line)
apply.sh:
for name in "$@"
do
python3 `dirname "$0"`/update.py < "$name" > "$name.tmp" && mv "$name.tmp" "$name"
rm -f "$name.tmp"
done
The actual commands:
From llvm/src:
find test/ -name *.ll | xargs ./apply.sh
From llvm/src/tools/clang:
find test/ -name *.mm -o -name *.m -o -name *.cpp -o -name *.c | xargs -I '{}' ../../apply.sh "{}"
From llvm/src/tools/polly:
find test/ -name *.ll | xargs ./apply.sh
After that, check-all (with llvm, clang, clang-tools-extra, lld,
compiler-rt, and polly all checked out).
The extra 'rm' in the apply.sh script is due to a few files in clang's test
suite using interesting unicode stuff that my python script was throwing
exceptions on. None of those files needed to be migrated, so it seemed
sufficient to ignore those cases.
Reviewers: rafael, dexonsmith, grosser
Differential Revision: http://reviews.llvm.org/D7636
llvm-svn: 230786
2015-02-28 03:29:02 +08:00
|
|
|
%arrayidx = getelementptr inbounds i32, i32* %vla, i64 %idxprom, !dbg !23
|
2012-05-09 02:56:00 +08:00
|
|
|
store i32 %mul, i32* %arrayidx, align 4, !dbg !23
|
|
|
|
br label %for.inc, !dbg !25
|
|
|
|
|
|
|
|
for.inc: ; preds = %for.body
|
2015-02-28 05:17:42 +08:00
|
|
|
%8 = load i32, i32* %i, align 4, !dbg !26
|
2012-05-09 02:56:00 +08:00
|
|
|
%inc = add nsw i32 %8, 1, !dbg !26
|
|
|
|
store i32 %inc, i32* %i, align 4, !dbg !26
|
|
|
|
br label %for.cond, !dbg !26
|
|
|
|
|
|
|
|
for.end: ; preds = %for.cond
|
2015-02-28 05:17:42 +08:00
|
|
|
%9 = load i8*, i8** %saved_stack, !dbg !27
|
2012-05-09 02:56:00 +08:00
|
|
|
call void @llvm.stackrestore(i8* %9), !dbg !27
|
|
|
|
ret void, !dbg !27
|
|
|
|
}
|
|
|
|
|
Move the complex address expression out of DIVariable and into an extra
argument of the llvm.dbg.declare/llvm.dbg.value intrinsics.
Previously, DIVariable was a variable-length field that has an optional
reference to a Metadata array consisting of a variable number of
complex address expressions. In the case of OpPiece expressions this is
wasting a lot of storage in IR, because when an aggregate type is, e.g.,
SROA'd into all of its n individual members, the IR will contain n copies
of the DIVariable, all alike, only differing in the complex address
reference at the end.
By making the complex address into an extra argument of the
dbg.value/dbg.declare intrinsics, all of the pieces can reference the
same variable and the complex address expressions can be uniqued across
the CU, too.
Down the road, this will allow us to move other flags, such as
"indirection" out of the DIVariable, too.
The new intrinsics look like this:
declare void @llvm.dbg.declare(metadata %storage, metadata %var, metadata %expr)
declare void @llvm.dbg.value(metadata %storage, i64 %offset, metadata %var, metadata %expr)
This patch adds a new LLVM-local tag to DIExpressions, so we can detect
and pretty-print DIExpression metadata nodes.
What this patch doesn't do:
This patch does not touch the "Indirect" field in DIVariable; but moving
that into the expression would be a natural next step.
http://reviews.llvm.org/D4919
rdar://problem/17994491
Thanks to dblaikie and dexonsmith for reviewing this patch!
Note: I accidentally committed a bogus older version of this patch previously.
llvm-svn: 218787
2014-10-02 02:55:02 +08:00
|
|
|
declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
|
2012-05-09 02:56:00 +08:00
|
|
|
|
|
|
|
declare i8* @llvm.stacksave() nounwind
|
|
|
|
|
|
|
|
declare void @llvm.stackrestore(i8*) nounwind
|
|
|
|
|
|
|
|
!llvm.dbg.cu = !{!0}
|
2013-11-23 05:49:45 +08:00
|
|
|
!llvm.module.flags = !{!29}
|
2012-05-09 02:56:00 +08:00
|
|
|
|
2016-04-01 08:16:49 +08:00
|
|
|
!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.2 (trunk 156005) (llvm/trunk 156000)", isOptimized: false, emissionKind: FullDebug, file: !28, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports: !1)
|
IR: Make metadata typeless in assembly
Now that `Metadata` is typeless, reflect that in the assembly. These
are the matching assembly changes for the metadata/value split in
r223802.
- Only use the `metadata` type when referencing metadata from a call
intrinsic -- i.e., only when it's used as a `Value`.
- Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
when referencing it from call intrinsics.
So, assembly like this:
define @foo(i32 %v) {
call void @llvm.foo(metadata !{i32 %v}, metadata !0)
call void @llvm.foo(metadata !{i32 7}, metadata !0)
call void @llvm.foo(metadata !1, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{metadata !3}, metadata !0)
ret void, !bar !2
}
!0 = metadata !{metadata !2}
!1 = metadata !{i32* @global}
!2 = metadata !{metadata !3}
!3 = metadata !{}
turns into this:
define @foo(i32 %v) {
call void @llvm.foo(metadata i32 %v, metadata !0)
call void @llvm.foo(metadata i32 7, metadata !0)
call void @llvm.foo(metadata i32* @global, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{!3}, metadata !0)
ret void, !bar !2
}
!0 = !{!2}
!1 = !{i32* @global}
!2 = !{!3}
!3 = !{}
I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines). I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.
This is part of PR21532.
llvm-svn: 224257
2014-12-16 03:07:53 +08:00
|
|
|
!1 = !{}
|
|
|
|
!3 = !{!5}
|
2015-11-06 06:03:56 +08:00
|
|
|
!5 = distinct !DISubprogram(name: "testVLAwithSize", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !28, scope: !6, type: !7, variables: !1)
|
2015-04-30 00:38:44 +08:00
|
|
|
!6 = !DIFile(filename: "bar.c", directory: "/Users/echristo/tmp")
|
|
|
|
!7 = !DISubroutineType(types: !8)
|
IR: Make metadata typeless in assembly
Now that `Metadata` is typeless, reflect that in the assembly. These
are the matching assembly changes for the metadata/value split in
r223802.
- Only use the `metadata` type when referencing metadata from a call
intrinsic -- i.e., only when it's used as a `Value`.
- Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
when referencing it from call intrinsics.
So, assembly like this:
define @foo(i32 %v) {
call void @llvm.foo(metadata !{i32 %v}, metadata !0)
call void @llvm.foo(metadata !{i32 7}, metadata !0)
call void @llvm.foo(metadata !1, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{metadata !3}, metadata !0)
ret void, !bar !2
}
!0 = metadata !{metadata !2}
!1 = metadata !{i32* @global}
!2 = metadata !{metadata !3}
!3 = metadata !{}
turns into this:
define @foo(i32 %v) {
call void @llvm.foo(metadata i32 %v, metadata !0)
call void @llvm.foo(metadata i32 7, metadata !0)
call void @llvm.foo(metadata i32* @global, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{!3}, metadata !0)
ret void, !bar !2
}
!0 = !{!2}
!1 = !{i32* @global}
!2 = !{!3}
!3 = !{}
I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines). I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.
This is part of PR21532.
llvm-svn: 224257
2014-12-16 03:07:53 +08:00
|
|
|
!8 = !{null, !9}
|
2015-04-30 00:38:44 +08:00
|
|
|
!9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
|
2015-08-01 02:58:39 +08:00
|
|
|
!10 = !DILocalVariable(name: "s", line: 1, arg: 1, scope: !5, file: !6, type: !9)
|
2015-04-30 00:38:44 +08:00
|
|
|
!11 = !DILocation(line: 1, column: 26, scope: !5)
|
|
|
|
!12 = !DILocation(line: 3, column: 13, scope: !13)
|
|
|
|
!13 = distinct !DILexicalBlock(line: 2, column: 1, file: !28, scope: !5)
|
2015-08-01 02:58:39 +08:00
|
|
|
!14 = !DILocalVariable(name: "vla", line: 3, scope: !13, file: !6, type: !15)
|
2015-04-30 00:38:44 +08:00
|
|
|
!15 = !DICompositeType(tag: DW_TAG_array_type, align: 32, baseType: !9, elements: !16)
|
IR: Make metadata typeless in assembly
Now that `Metadata` is typeless, reflect that in the assembly. These
are the matching assembly changes for the metadata/value split in
r223802.
- Only use the `metadata` type when referencing metadata from a call
intrinsic -- i.e., only when it's used as a `Value`.
- Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
when referencing it from call intrinsics.
So, assembly like this:
define @foo(i32 %v) {
call void @llvm.foo(metadata !{i32 %v}, metadata !0)
call void @llvm.foo(metadata !{i32 7}, metadata !0)
call void @llvm.foo(metadata !1, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{metadata !3}, metadata !0)
ret void, !bar !2
}
!0 = metadata !{metadata !2}
!1 = metadata !{i32* @global}
!2 = metadata !{metadata !3}
!3 = metadata !{}
turns into this:
define @foo(i32 %v) {
call void @llvm.foo(metadata i32 %v, metadata !0)
call void @llvm.foo(metadata i32 7, metadata !0)
call void @llvm.foo(metadata i32* @global, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{!3}, metadata !0)
ret void, !bar !2
}
!0 = !{!2}
!1 = !{i32* @global}
!2 = !{!3}
!3 = !{}
I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines). I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.
This is part of PR21532.
llvm-svn: 224257
2014-12-16 03:07:53 +08:00
|
|
|
!16 = !{!17}
|
2015-04-30 00:38:44 +08:00
|
|
|
!17 = !DISubrange(count: -1)
|
|
|
|
!18 = !DILocation(line: 3, column: 7, scope: !13)
|
2015-08-01 02:58:39 +08:00
|
|
|
!19 = !DILocalVariable(name: "i", line: 4, scope: !13, file: !6, type: !9)
|
2015-04-30 00:38:44 +08:00
|
|
|
!20 = !DILocation(line: 4, column: 7, scope: !13)
|
|
|
|
!21 = !DILocation(line: 5, column: 8, scope: !22)
|
|
|
|
!22 = distinct !DILexicalBlock(line: 5, column: 3, file: !28, scope: !13)
|
|
|
|
!23 = !DILocation(line: 6, column: 5, scope: !24)
|
|
|
|
!24 = distinct !DILexicalBlock(line: 5, column: 27, file: !28, scope: !22)
|
|
|
|
!25 = !DILocation(line: 7, column: 3, scope: !24)
|
|
|
|
!26 = !DILocation(line: 5, column: 22, scope: !22)
|
|
|
|
!27 = !DILocation(line: 8, column: 1, scope: !13)
|
|
|
|
!28 = !DIFile(filename: "bar.c", directory: "/Users/echristo/tmp")
|
2015-03-04 01:24:31 +08:00
|
|
|
!29 = !{i32 1, !"Debug Info Version", i32 3}
|
Clean up the processing of dbg.value in various places
Summary:
First up is instcombine, where in the dbg.declare -> dbg.value conversion,
the llvm.dbg.value needs to be called on the actual loaded value, rather
than the address (since the whole point of this transformation is to be
able to get rid of the alloca). Further, now that that's cleaned up, we
can remove a hack in the backend, that would add an implicit OP_deref if
the argument to dbg.value was an alloca. This stems from before the
existence of DIExpression and is no longer necessary since the deref can
be expressed explicitly.
Now, in order to make sure that the tests pass with this change, we need to
correct the printing of DEBUG_VALUE comments to take into account the
expression, which wasn't taken into account before.
Unfortunately, for both these changes, there were a number of incorrect
test cases (mostly the wrong number of DW_OP_derefs, but also a couple
where the test itself was broken more badly). aprantl and I have gone
through and adjusted these test case in order to make them pass with
these fixes and in some cases to make sure they're actually testing
what they are meant to test.
Reviewers: aprantl
Subscribers: dsanders
Differential Revision: http://reviews.llvm.org/D14186
llvm-svn: 256077
2015-12-19 10:02:44 +08:00
|
|
|
!30 = !DIExpression(DW_OP_deref)
|