2011-04-22 07:22:35 +08:00
; RUN: llc < %s - | FileCheck %s
target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:32:64-v128:32:128-a0:0:32-n32"
target triple = "thumbv7-apple-macosx10.6.7"
2015-01-13 06:19:22 +08:00
;CHECK: sub-register DW_OP_regx
2015-03-03 06:02:33 +08:00
;CHECK-NEXT: 256
[DebugInfo] Align comments in debug_loc section
Summary:
This commit updates the BufferByteStreamer, used by DebugLocStream
to buffer bytes/comments to put in the debug_loc section, to
make sure that the Buffer and Comments vectors are synced.
Previously, when an SLEB128 or ULEB128 was emitted together with
a comment, the vectors could be out-of-sync if the LEB encoding
added several entries to the Buffer vectors, while we only added
a single entry to the Comments vector.
The goal with this is to get the comments in the debug_loc
section in the .s file correctly aligned.
Example (using ARM as target):
Instead of
.byte 144 @ sub-register DW_OP_regx
.byte 128 @ 256
.byte 2 @ DW_OP_piece
.byte 147 @ 8
.byte 8 @ sub-register DW_OP_regx
.byte 144 @ 257
.byte 129 @ DW_OP_piece
.byte 2 @ 8
.byte 147 @
.byte 8 @
we now get
.byte 144 @ sub-register DW_OP_regx
.byte 128 @ 256
.byte 2 @
.byte 147 @ DW_OP_piece
.byte 8 @ 8
.byte 144 @ sub-register DW_OP_regx
.byte 129 @ 257
.byte 2 @
.byte 147 @ DW_OP_piece
.byte 8 @ 8
Reviewers: JDevlieghere, rnk, aprantl
Reviewed By: aprantl
Subscribers: davide, Ka-Ka, uabelho, aemerson, javed.absar, kristof.beyls, llvm-commits, JDevlieghere
Differential Revision: https://reviews.llvm.org/D41763
llvm-svn: 321907
2018-01-06 06:20:30 +08:00
;CHECK-NEXT: @
2014-02-28 01:56:08 +08:00
;CHECK-NEXT: DW_OP_piece
2015-03-03 06:02:33 +08:00
;CHECK-NEXT: 8
2015-01-13 06:19:22 +08:00
;CHECK-NEXT: sub-register DW_OP_regx
2015-03-03 06:02:33 +08:00
;CHECK-NEXT: 257
[DebugInfo] Align comments in debug_loc section
Summary:
This commit updates the BufferByteStreamer, used by DebugLocStream
to buffer bytes/comments to put in the debug_loc section, to
make sure that the Buffer and Comments vectors are synced.
Previously, when an SLEB128 or ULEB128 was emitted together with
a comment, the vectors could be out-of-sync if the LEB encoding
added several entries to the Buffer vectors, while we only added
a single entry to the Comments vector.
The goal with this is to get the comments in the debug_loc
section in the .s file correctly aligned.
Example (using ARM as target):
Instead of
.byte 144 @ sub-register DW_OP_regx
.byte 128 @ 256
.byte 2 @ DW_OP_piece
.byte 147 @ 8
.byte 8 @ sub-register DW_OP_regx
.byte 144 @ 257
.byte 129 @ DW_OP_piece
.byte 2 @ 8
.byte 147 @
.byte 8 @
we now get
.byte 144 @ sub-register DW_OP_regx
.byte 128 @ 256
.byte 2 @
.byte 147 @ DW_OP_piece
.byte 8 @ 8
.byte 144 @ sub-register DW_OP_regx
.byte 129 @ 257
.byte 2 @
.byte 147 @ DW_OP_piece
.byte 8 @ 8
Reviewers: JDevlieghere, rnk, aprantl
Reviewed By: aprantl
Subscribers: davide, Ka-Ka, uabelho, aemerson, javed.absar, kristof.beyls, llvm-commits, JDevlieghere
Differential Revision: https://reviews.llvm.org/D41763
llvm-svn: 321907
2018-01-06 06:20:30 +08:00
;CHECK-NEXT: @
2014-02-28 01:56:08 +08:00
;CHECK-NEXT: DW_OP_piece
2015-03-03 06:02:33 +08:00
;CHECK-NEXT: 8
2011-04-22 07:22:35 +08:00
@.str = external constant [ 13 x i8 ]
declare < 4 x float > @test0001 ( float ) nounwind readnone ssp
2015-11-06 06:03:56 +08:00
define i32 @main ( i32 %argc , i8 * * nocapture %argv ) nounwind ssp !dbg !10 {
2011-04-22 07:22:35 +08:00
entry:
br label %for.body9
for.body9: ; preds = %for.body9, %entry
%add19 = fadd < 4 x float > undef , < float 0.000000e+00 , float 0.000000e+00 , float 0.000000e+00 , float 1.000000e+00 > , !dbg !39
br i1 undef , label %for.end54 , label %for.body9 , !dbg !44
for.end54: ; preds = %for.body9
2017-07-29 04:21:02 +08:00
tail call void @llvm.dbg.value ( metadata < 4 x float > %add19 , metadata !27 , metadata !DIExpression ( ) ) , !dbg !39
2011-04-22 07:22:35 +08:00
%tmp115 = extractelement < 4 x float > %add19 , i32 1
%conv6.i75 = fpext float %tmp115 to double , !dbg !45
[opaque pointer type] Add textual IR support for explicit type parameter to the call instruction
See r230786 and r230794 for similar changes to gep and load
respectively.
Call is a bit different because it often doesn't have a single explicit
type - usually the type is deduced from the arguments, and just the
return type is explicit. In those cases there's no need to change the
IR.
When that's not the case, the IR usually contains the pointer type of
the first operand - but since typed pointers are going away, that
representation is insufficient so I'm just stripping the "pointerness"
of the explicit type away.
This does make the IR a bit weird - it /sort of/ reads like the type of
the first operand: "call void () %x(" but %x is actually of type "void
()*" and will eventually be just of type "ptr". But this seems not too
bad and I don't think it would benefit from repeating the type
("void (), void () * %x(" and then eventually "void (), ptr %x(") as has
been done with gep and load.
This also has a side benefit: since the explicit type is no longer a
pointer, there's no ambiguity between an explicit type and a function
that returns a function pointer. Previously this case needed an explicit
type (eg: a function returning a void() function was written as
"call void () () * @x(" rather than "call void () * @x(" because of the
ambiguity between a function returning a pointer to a void() function
and a function returning void).
No ambiguity means even function pointer return types can just be
written alone, without writing the whole function's type.
This leaves /only/ the varargs case where the explicit type is required.
Given the special type syntax in call instructions, the regex-fu used
for migration was a bit more involved in its own unique way (as every
one of these is) so here it is. Use it in conjunction with the apply.sh
script and associated find/xargs commands I've provided in rr230786 to
migrate your out of tree tests. Do let me know if any of this doesn't
cover your cases & we can iterate on a more general script/regexes to
help others with out of tree tests.
About 9 test cases couldn't be automatically migrated - half of those
were functions returning function pointers, where I just had to manually
delete the function argument types now that we didn't need an explicit
function type there. The other half were typedefs of function types used
in calls - just had to manually drop the * from those.
import fileinput
import sys
import re
pat = re.compile(r'((?:=|:|^|\s)call\s(?:[^@]*?))(\s*$|\s*(?:(?:\[\[[a-zA-Z0-9_]+\]\]|[@%](?:(")?[\\\?@a-zA-Z0-9_.]*?(?(3)"|)|{{.*}}))(?:\(|$)|undef|inttoptr|bitcast|null|asm).*$)')
addrspace_end = re.compile(r"addrspace\(\d+\)\s*\*$")
func_end = re.compile("(?:void.*|\)\s*)\*$")
def conv(match, line):
if not match or re.search(addrspace_end, match.group(1)) or not re.search(func_end, match.group(1)):
return line
return line[:match.start()] + match.group(1)[:match.group(1).rfind('*')].rstrip() + match.group(2) + line[match.end():]
for line in sys.stdin:
sys.stdout.write(conv(re.search(pat, line), line))
llvm-svn: 235145
2015-04-17 07:24:18 +08:00
%call.i82 = tail call i32 ( i8 * , . . . ) @printf ( i8 * getelementptr inbounds ( [ 13 x i8 ] , [ 13 x i8 ] * @.str , i32 0 , i32 0 ) , double undef , double %conv6.i75 , double undef , double undef ) nounwind , !dbg !45
2011-04-22 07:22:35 +08:00
ret i32 0 , !dbg !49
}
declare i32 @printf ( i8 * nocapture , . . . ) nounwind
2017-07-29 04:21:02 +08:00
declare void @llvm.dbg.value ( metadata , metadata , metadata ) nounwind readnone
2011-04-22 07:22:35 +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 = ! { !56 }
2011-04-22 07:22:35 +08:00
2016-04-15 23:57:41 +08:00
!0 = distinct !DISubprogram ( name: "test0001" , line: 3 , 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 , unit: !2 , scopeLine: 3 , file: !54 , scope: !1 , type: !3 , variables: !51 )
2015-04-30 00:38:44 +08:00
!1 = !DIFile ( filename: "build2.c" , directory: "/private/tmp" )
2016-04-15 23:57:41 +08:00
!2 = distinct !DICompileUnit ( language: D W _ L A N G _ C 99 , producer: "clang version 3.0 (trunk 129915)" , isOptimized: true , emissionKind: F u l l D e b u g , file: !54 , enums: ! { } , retainedTypes: ! { } , imports: null )
2015-04-30 00:38:44 +08:00
!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 = !DIDerivedType ( tag: D W _ T A G _ t y p e d e f , name: "v4f32" , line: 14 , file: !54 , scope: !2 , baseType: !6 )
!6 = !DICompositeType ( tag: D W _ T A G _ a r r a y _ type , size: 128 , align: 128 , file: !1 , baseType: !7 , elements: !8 )
!7 = !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 )
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 = ! { !9 }
2015-04-30 00:38:44 +08:00
!9 = !DISubrange ( count: 4 )
2016-04-15 23:57:41 +08:00
!10 = distinct !DISubprogram ( name: "main" , line: 59 , 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 , unit: !2 , scopeLine: 59 , file: !54 , scope: !1 , type: !11 , variables: !52 )
2015-04-30 00:38:44 +08:00
!11 = !DISubroutineType ( types: !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
!12 = ! { !13 }
2015-04-30 00:38:44 +08:00
!13 = !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 )
2016-04-15 23:57:41 +08:00
!14 = distinct !DISubprogram ( name: "printFV" , line: 41 , isLocal: true , isDefinition: true , virtualIndex: 6 , flags: D I F l a g P r o t o t y p e d , isOptimized: true , unit: !2 , scopeLine: 41 , file: !55 , scope: !15 , type: !16 , variables: !53 )
2015-04-30 00:38:44 +08:00
!15 = !DIFile ( filename: "/Volumes/Lalgate/work/llvm/projects/llvm-test/SingleSource/UnitTests/Vector/helpers.h" , directory: "/private/tmp" )
!16 = !DISubroutineType ( types: !17 )
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
!17 = ! { null }
2015-08-01 02:58:39 +08:00
!18 = !DILocalVariable ( name: "a" , line: 3 , arg: 1 , scope: !0 , file: !1 , type: !7 )
!19 = !DILocalVariable ( name: "argc" , line: 59 , arg: 1 , scope: !10 , file: !1 , type: !13 )
!20 = !DILocalVariable ( name: "argv" , line: 59 , arg: 2 , scope: !10 , file: !1 , type: !21 )
2015-04-30 00:38:44 +08:00
!21 = !DIDerivedType ( tag: D W _ T A G _ p o i n t e r _ type , size: 32 , align: 32 , scope: !2 , baseType: !22 )
!22 = !DIDerivedType ( tag: D W _ T A G _ p o i n t e r _ type , size: 32 , align: 32 , scope: !2 , baseType: !23 )
!23 = !DIBasicType ( tag: D W _ T A G _ b a s e _ type , name: "char" , size: 8 , align: 8 , encoding: D W _ A T E _ s i g n e d _ c h a r )
2015-08-01 02:58:39 +08:00
!24 = !DILocalVariable ( name: "i" , line: 60 , scope: !25 , file: !1 , type: !13 )
2015-04-30 00:38:44 +08:00
!25 = distinct !DILexicalBlock ( line: 59 , column: 33 , file: !54 , scope: !10 )
2015-08-01 02:58:39 +08:00
!26 = !DILocalVariable ( name: "j" , line: 60 , scope: !25 , file: !1 , type: !13 )
!27 = !DILocalVariable ( name: "x" , line: 61 , scope: !25 , file: !1 , type: !5 )
!28 = !DILocalVariable ( name: "y" , line: 62 , scope: !25 , file: !1 , type: !5 )
!29 = !DILocalVariable ( name: "z" , line: 63 , scope: !25 , file: !1 , type: !5 )
!30 = !DILocalVariable ( name: "F" , line: 41 , arg: 1 , scope: !14 , file: !15 , type: !31 )
2015-04-30 00:38:44 +08:00
!31 = !DIDerivedType ( tag: D W _ T A G _ p o i n t e r _ type , size: 32 , align: 32 , scope: !2 , baseType: !32 )
!32 = !DIDerivedType ( tag: D W _ T A G _ t y p e d e f , name: "FV" , line: 25 , file: !55 , scope: !2 , baseType: !33 )
!33 = !DICompositeType ( tag: D W _ T A G _ u n i o n _ type , line: 22 , size: 128 , align: 128 , file: !55 , scope: !2 , elements: !34 )
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 = ! { !35 , !37 }
2015-04-30 00:38:44 +08:00
!35 = !DIDerivedType ( tag: D W _ T A G _ m e m b e r , name: "V" , line: 23 , size: 128 , align: 128 , file: !55 , scope: !15 , baseType: !36 )
!36 = !DIDerivedType ( tag: D W _ T A G _ t y p e d e f , name: "v4sf" , line: 3 , file: !55 , scope: !2 , baseType: !6 )
!37 = !DIDerivedType ( tag: D W _ T A G _ m e m b e r , name: "A" , line: 24 , size: 128 , align: 32 , file: !55 , scope: !15 , baseType: !38 )
!38 = !DICompositeType ( tag: D W _ T A G _ a r r a y _ type , size: 128 , align: 32 , scope: !2 , baseType: !7 , elements: !8 )
!39 = !DILocation ( line: 79 , column: 7 , scope: !40 )
!40 = distinct !DILexicalBlock ( line: 75 , column: 35 , file: !54 , scope: !41 )
!41 = distinct !DILexicalBlock ( line: 75 , column: 5 , file: !54 , scope: !42 )
!42 = distinct !DILexicalBlock ( line: 71 , column: 32 , file: !54 , scope: !43 )
!43 = distinct !DILexicalBlock ( line: 71 , column: 3 , file: !54 , scope: !25 )
!44 = !DILocation ( line: 75 , column: 5 , scope: !42 )
!45 = !DILocation ( line: 42 , column: 2 , scope: !46 , inlinedAt: !48 )
!46 = distinct !DILexicalBlock ( line: 42 , column: 2 , file: !55 , scope: !47 )
!47 = distinct !DILexicalBlock ( line: 41 , column: 28 , file: !55 , scope: !14 )
!48 = !DILocation ( line: 95 , column: 3 , scope: !25 )
!49 = !DILocation ( line: 99 , column: 3 , scope: !25 )
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
!51 = ! { !18 }
!52 = ! { !19 , !20 , !24 , !26 , !27 , !28 , !29 }
!53 = ! { !30 }
2015-04-30 00:38:44 +08:00
!54 = !DIFile ( filename: "build2.c" , directory: "/private/tmp" )
!55 = !DIFile ( filename: "/Volumes/Lalgate/work/llvm/projects/llvm-test/SingleSource/UnitTests/Vector/helpers.h" , directory: "/private/tmp" )
2015-03-04 01:24:31 +08:00
!56 = ! { i32 1 , !"Debug Info Version" , i32 3 }