2014-03-08 06:00:49 +08:00
; RUN: llc -mtriple=x86_64-apple-darwin < %s -filetype=obj \
; RUN: | llvm-dwarfdump -debug-dump=info - | FileCheck --check-prefix=CHECK --check-prefix=DARWIN %s
; RUN: llc -mtriple=x86_64-linux-gnu < %s -filetype=obj \
; RUN: | llvm-dwarfdump -debug-dump=info - | FileCheck --check-prefix=CHECK --check-prefix=LINUX %s
; RUN: llc -mtriple=x86_64-apple-darwin < %s -filetype=obj -regalloc=basic \
; RUN: | llvm-dwarfdump -debug-dump=info - | FileCheck --check-prefix=CHECK --check-prefix=DARWIN %s
2011-02-19 06:43:42 +08:00
2014-05-28 02:37:55 +08:00
; CHECK: DW_TAG_subprogram
2014-10-06 11:36:31 +08:00
; CHECK: DW_AT_abstract_origin {{.*}} "foo"
2014-05-28 02:37:55 +08:00
; CHECK: DW_TAG_formal_parameter
2014-06-14 05:52:33 +08:00
; CHECK-NOT: DW_TAG
2014-10-10 23:51:02 +08:00
; CHECK: DW_AT_abstract_origin {{.*}} "sp"
2014-05-28 02:37:55 +08:00
; CHECK: DW_TAG_formal_parameter
2014-06-14 05:52:33 +08:00
; CHECK-NOT: DW_TAG
2014-10-10 23:51:02 +08:00
; CHECK: DW_AT_abstract_origin {{.*}} "nums"
2014-05-28 02:37:55 +08:00
2014-10-06 11:36:31 +08:00
; CHECK: DW_TAG_subprogram
2014-06-14 05:52:33 +08:00
; CHECK-NOT: DW_TAG
DebugInfo: Lazily attach definition attributes to definitions.
This is a precursor to fixing inlined debug info where the concrete,
out-of-line definition may preceed any inlined usage. To cope with this,
the attributes that may appear on the concrete definition or the
abstract definition are delayed until the end of the module. Then, if an
abstract definition was created, it is referenced (and no other
attributes are added to the out-of-line definition), otherwise the
attributes are added directly to the out-of-line definition.
In a couple of cases this causes not just reordering of attributes, but
reordering of types. When the creation of the attribute is delayed, if
that creation would create a type (such as for a DW_AT_type attribute)
then other top level DIEs may've been constructed during the delay,
causing the referenced type to be created and added after those
intervening DIEs. In the extreme case, in cross-cu-inlining.ll, this
actually causes the DW_TAG_basic_type for "int" to move from one CU to
another.
llvm-svn: 209674
2014-05-28 02:37:43 +08:00
; CHECK: DW_AT_name {{.*}} "foo"
2014-10-10 23:51:02 +08:00
; CHECK: DW_TAG_formal_parameter
2014-06-14 05:52:33 +08:00
; CHECK-NOT: DW_TAG
; CHECK: DW_AT_name {{.*}} "sp"
2014-10-10 23:51:02 +08:00
; CHECK: DW_TAG_formal_parameter
2014-06-14 05:52:33 +08:00
; CHECK-NOT: DW_TAG
; CHECK: DW_AT_name {{.*}} "nums"
2014-05-28 01:57:14 +08:00
2013-06-20 08:25:24 +08:00
;CHECK: DW_TAG_inlined_subroutine
2014-10-06 11:36:31 +08:00
;CHECK-NEXT: DW_AT_abstract_origin {{.*}} "foo"
2014-03-08 06:00:56 +08:00
;CHECK-NEXT: DW_AT_low_pc [DW_FORM_addr]
2014-03-08 07:07:21 +08:00
;CHECK-NEXT: DW_AT_high_pc [DW_FORM_data4]
2011-02-19 06:43:42 +08:00
;CHECK-NEXT: DW_AT_call_file
;CHECK-NEXT: DW_AT_call_line
2012-12-27 10:13:58 +08:00
2013-06-20 08:25:24 +08:00
;CHECK: DW_TAG_formal_parameter
2014-03-08 06:00:49 +08:00
;FIXME: Linux shouldn't drop this parameter either...
2014-06-14 05:52:33 +08:00
;CHECK-NOT: DW_TAG
2014-10-10 23:51:02 +08:00
;DARWIN: DW_AT_abstract_origin {{.*}} "sp"
2014-03-08 06:00:49 +08:00
;DARWIN: DW_TAG_formal_parameter
2014-10-10 23:51:02 +08:00
;CHECK: DW_AT_abstract_origin {{.*}} "nums"
2014-05-28 01:57:14 +08:00
;CHECK-NOT: DW_TAG_formal_parameter
2011-02-19 06:43:42 +08:00
%struct.S1 = type { float * , i32 }
@p = common global %struct.S1 zeroinitializer , align 8
define i32 @foo ( %struct.S1 * nocapture %sp , i32 %nums ) nounwind optsize ssp {
entry:
2015-04-30 00:38:44 +08:00
tail call void @llvm.dbg.value ( metadata %struct.S1 * %sp , i64 0 , metadata !9 , metadata !DIExpression ( ) ) , !dbg !20
tail call void @llvm.dbg.value ( metadata i32 %nums , i64 0 , metadata !18 , metadata !DIExpression ( ) ) , !dbg !21
[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
%tmp2 = getelementptr inbounds %struct.S1 , %struct.S1 * %sp , i64 0 , i32 1 , !dbg !22
2013-05-03 02:11:35 +08:00
store i32 %nums , i32 * %tmp2 , align 4 , !dbg !22
2011-02-19 06:43:42 +08:00
%call = tail call float * @bar ( i32 %nums ) nounwind optsize , !dbg !27
[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
%tmp5 = getelementptr inbounds %struct.S1 , %struct.S1 * %sp , i64 0 , i32 0 , !dbg !27
2013-05-03 02:11:35 +08:00
store float * %call , float * * %tmp5 , align 8 , !dbg !27
2011-02-19 06:43:42 +08:00
%cmp = icmp ne float * %call , null , !dbg !29
%cond = zext i1 %cmp to i32 , !dbg !29
ret i32 %cond , !dbg !29
}
declare float * @bar ( i32 ) optsize
define void @foobar ( ) nounwind optsize ssp {
entry:
2015-04-30 00:38:44 +08:00
tail call void @llvm.dbg.value ( metadata %struct.S1 * @p , i64 0 , metadata !9 , metadata !DIExpression ( ) ) nounwind , !dbg !31
tail call void @llvm.dbg.value ( metadata i32 1 , i64 0 , metadata !18 , metadata !DIExpression ( ) ) nounwind , !dbg !35
2015-03-14 02:20:45 +08:00
store i32 1 , i32 * getelementptr inbounds ( %struct.S1 , %struct.S1 * @p , i64 0 , i32 1 ) , align 8 , !dbg !36
2011-02-19 06:43:42 +08:00
%call.i = tail call float * @bar ( i32 1 ) nounwind optsize , !dbg !37
2015-03-14 02:20:45 +08:00
store float * %call.i , float * * getelementptr inbounds ( %struct.S1 , %struct.S1 * @p , i64 0 , i32 0 ) , align 8 , !dbg !37
2011-02-19 06:43:42 +08:00
ret void , !dbg !38
}
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.value ( metadata , i64 , metadata , metadata ) nounwind readnone
2011-02-19 06:43:42 +08:00
2013-03-08 08:23:31 +08:00
!llvm.dbg.cu = ! { !2 }
2013-11-23 05:49:45 +08:00
!llvm.module.flags = ! { !43 }
2011-02-19 06:43:42 +08:00
2015-04-30 00:38:44 +08:00
!0 = !DISubprogram ( name: "foo" , line: 8 , isLocal: false , isDefinition: true , virtualIndex: 6 , flags: D I F l a g P r o t o t y p e d , isOptimized: true , scopeLine: 8 , file: !1 , scope: !1 , type: !3 , function: i32 ( %struct.S1 * , i32 ) * @foo , variables: !41 )
!1 = !DIFile ( filename: "nm2.c" , directory: "/private/tmp" )
!2 = !DICompileUnit ( language: D W _ L A N G _ C 99 , producer: "clang version 2.9 (trunk 125693)" , isOptimized: true , emissionKind: 1 , file: !42 , enums: ! { } , retainedTypes: ! { } , subprograms: !39 , globals: !40 , imports: !44 )
!3 = !DISubroutineType ( types: !4 )
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
!4 = ! { !5 }
2015-04-30 00:38:44 +08:00
!5 = !DIBasicType ( tag: D W _ T A G _ b a s e _ type , name: "int" , size: 32 , align: 32 , encoding: D W _ A T E _ s i g n e d )
!6 = !DISubprogram ( name: "foobar" , line: 15 , isLocal: false , isDefinition: true , virtualIndex: 6 , isOptimized: true , file: !1 , scope: !1 , type: !7 , function: void ( ) * @foobar )
!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 }
2015-04-30 00:38:44 +08:00
!9 = !DILocalVariable ( tag: D W _ T A G _ a r g _ v a r i a b l e , name: "sp" , line: 7 , arg: 1 , scope: !0 , file: !1 , type: !10 )
!10 = !DIDerivedType ( tag: D W _ T A G _ p o i n t e r _ type , size: 64 , align: 64 , scope: !2 , baseType: !11 )
!11 = !DIDerivedType ( tag: D W _ T A G _ t y p e d e f , name: "S1" , line: 4 , file: !42 , scope: !2 , baseType: !12 )
!12 = !DICompositeType ( tag: D W _ T A G _ s t r u c t u r e _ type , name: "S1" , line: 1 , size: 128 , align: 64 , file: !42 , scope: !2 , elements: !13 )
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
!13 = ! { !14 , !17 }
2015-04-30 00:38:44 +08:00
!14 = !DIDerivedType ( tag: D W _ T A G _ m e m b e r , name: "m" , line: 2 , size: 64 , align: 64 , file: !42 , scope: !1 , baseType: !15 )
!15 = !DIDerivedType ( tag: D W _ T A G _ p o i n t e r _ type , size: 64 , align: 64 , scope: !2 , baseType: !16 )
!16 = !DIBasicType ( tag: D W _ T A G _ b a s e _ type , name: "float" , size: 32 , align: 32 , encoding: D W _ A T E _ float )
!17 = !DIDerivedType ( tag: D W _ T A G _ m e m b e r , name: "nums" , line: 3 , size: 32 , align: 32 , offset: 64 , file: !42 , scope: !1 , baseType: !5 )
!18 = !DILocalVariable ( tag: D W _ T A G _ a r g _ v a r i a b l e , name: "nums" , line: 7 , arg: 2 , scope: !0 , file: !1 , type: !5 )
!19 = !DIGlobalVariable ( name: "p" , line: 14 , isLocal: false , isDefinition: true , scope: !2 , file: !1 , type: !11 , variable: %struct.S1 * @p )
!20 = !DILocation ( line: 7 , column: 13 , scope: !0 )
!21 = !DILocation ( line: 7 , column: 21 , scope: !0 )
!22 = !DILocation ( line: 9 , column: 3 , scope: !23 )
!23 = distinct !DILexicalBlock ( line: 8 , column: 1 , file: !1 , scope: !0 )
!27 = !DILocation ( line: 10 , column: 3 , scope: !23 )
!29 = !DILocation ( line: 11 , column: 3 , scope: !23 )
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
!30 = ! { %struct.S1 * @p }
2015-04-30 00:38:44 +08:00
!31 = !DILocation ( line: 7 , column: 13 , scope: !0 , inlinedAt: !32 )
!32 = !DILocation ( line: 16 , column: 3 , scope: !33 )
!33 = distinct !DILexicalBlock ( line: 15 , column: 15 , file: !1 , scope: !6 )
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
!34 = ! { i32 1 }
2015-04-30 00:38:44 +08:00
!35 = !DILocation ( line: 7 , column: 21 , scope: !0 , inlinedAt: !32 )
!36 = !DILocation ( line: 9 , column: 3 , scope: !23 , inlinedAt: !32 )
!37 = !DILocation ( line: 10 , column: 3 , scope: !23 , inlinedAt: !32 )
!38 = !DILocation ( line: 17 , column: 1 , scope: !33 )
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
!39 = ! { !0 , !6 }
!40 = ! { !19 }
!41 = ! { !9 , !18 }
2015-04-30 00:38:44 +08:00
!42 = !DIFile ( filename: "nm2.c" , directory: "/private/tmp" )
2015-03-04 01:24:31 +08:00
!43 = ! { i32 1 , !"Debug Info Version" , i32 3 }
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
!44 = ! { }