2017-08-28 22:20:47 +02:00
; RUN: llc < %s -mtriple=arm-linux-unknown-gnueabi -mattr=+v4t -verify-machineinstrs -filetype=asm | FileCheck %s -check-prefix=ARM-linux
; RUN: llc < %s -mtriple=arm-linux-unknown-gnueabi -mattr=+v4t -filetype=obj
2014-04-02 18:10:33 +02:00
!llvm.dbg.cu = ! { !0 }
!llvm.module.flags = ! { !9 , !10 }
!llvm.ident = ! { !11 }
2015-11-05 23:03:56 +01:00
define void @test_basic ( ) #0 !dbg !4 {
2014-04-02 18:10:33 +02:00
%mem = alloca i32 , i32 10
call void @dummy_use ( i32 * %mem , i32 10 )
ret void
; ARM-linux: test_basic:
; ARM-linux: push {r4, r5}
; ARM-linux: .cfi_def_cfa_offset 8
; ARM-linux: .cfi_offset r5, -4
; ARM-linux: .cfi_offset r4, -8
; ARM-linux-NEXT: mrc p15, #0, r4, c13, c0, #3
; ARM-linux-NEXT: mov r5, sp
; ARM-linux-NEXT: ldr r4, [r4, #4]
; ARM-linux-NEXT: cmp r4, r5
; ARM-linux-NEXT: blo .LBB0_2
; ARM-linux: mov r4, #48
; ARM-linux-NEXT: mov r5, #0
; ARM-linux-NEXT: stmdb sp!, {lr}
; ARM-linux: .cfi_def_cfa_offset 12
; ARM-linux: .cfi_offset lr, -12
; ARM-linux-NEXT: bl __morestack
; ARM-linux-NEXT: ldm sp!, {lr}
; ARM-linux-NEXT: pop {r4, r5}
; ARM-linux: .cfi_def_cfa_offset 0
; ARM-linux-NEXT: bx lr
; ARM-linux: pop {r4, r5}
; ARM-linux: .cfi_def_cfa_offset 0
2020-04-03 00:28:32 +02:00
; ARM-linux: .cfi_same_value r4
; ARM-linux: .cfi_same_value r5
2014-04-02 18:10:33 +02:00
}
2016-04-15 17:57:41 +02:00
!0 = distinct !DICompileUnit ( language: D W _ L A N G _ C 99 , producer: "clang version 3.5 " , isOptimized: false , emissionKind: F u l l D e b u g , file: !1 , enums: !2 , retainedTypes: !2 , globals: !2 , imports: !2 )
2015-04-29 18:38:44 +02:00
!1 = !DIFile ( filename: "var.c" , directory: "/tmp" )
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-15 20:07:53 +01:00
!2 = ! { }
[DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label.
In order to set breakpoints on labels and list source code around
labels, we need collect debug information for labels, i.e., label
name, the function label belong, line number in the file, and the
address label located. In order to keep these information in LLVM
IR and to allow backend to generate debug information correctly.
We create a new kind of metadata for labels, DILabel. The format
of DILabel is
!DILabel(scope: !1, name: "foo", file: !2, line: 3)
We hope to keep debug information as much as possible even the
code is optimized. So, we create a new kind of intrinsic for label
metadata to avoid the metadata is eliminated with basic block.
The intrinsic will keep existing if we keep it from optimized out.
The format of the intrinsic is
llvm.dbg.label(metadata !1)
It has only one argument, that is the DILabel metadata. The
intrinsic will follow the label immediately. Backend could get the
label metadata through the intrinsic's parameter.
We also create DIBuilder API for labels to be used by Frontend.
Frontend could use createLabel() to allocate DILabel objects, and use
insertLabel() to insert llvm.dbg.label intrinsic in LLVM IR.
Differential Revision: https://reviews.llvm.org/D45024
Patch by Hsiangkai Wang.
llvm-svn: 331841
2018-05-09 04:40:45 +02:00
!4 = distinct !DISubprogram ( name: "test_basic" , line: 5 , isLocal: false , isDefinition: true , virtualIndex: 6 , flags: D I F l a g P r o t o t y p e d , isOptimized: false , unit: !0 , scopeLine: 5 , file: !1 , scope: !5 , type: !6 , retainedNodes: !2 )
2015-04-29 18:38:44 +02:00
!5 = !DIFile ( filename: "var.c" , directory: "/tmp" )
!6 = !DISubroutineType ( types: !7 )
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-15 20:07:53 +01:00
!7 = ! { !8 , !8 }
2015-04-29 18:38:44 +02:00
!8 = !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 )
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-15 20:07:53 +01:00
!9 = ! { i32 2 , !"Dwarf Version" , i32 4 }
2015-03-03 18:24:31 +01:00
!10 = ! { 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-15 20:07:53 +01:00
!11 = ! { !"clang version 3.5 " }
2015-07-31 20:58:39 +02:00
!12 = !DILocalVariable ( name: "count" , line: 5 , arg: 1 , scope: !4 , file: !5 , type: !8 )
2015-04-29 18:38:44 +02:00
!13 = !DILocation ( line: 5 , scope: !4 )
2015-07-31 20:58:39 +02:00
!14 = !DILocalVariable ( name: "vl" , line: 6 , scope: !4 , file: !5 , type: !15 )
2015-04-29 18:38:44 +02:00
!15 = !DIDerivedType ( tag: D W _ T A G _ t y p e d e f , name: "va_list" , line: 30 , file: !16 , baseType: !17 )
!16 = !DIFile ( filename: "/linux-x86_64-high/gcc_4.7.2/dbg/llvm/bin/../lib/clang/3.5/include/stdarg.h" , directory: "/tmp" )
!17 = !DIDerivedType ( tag: D W _ T A G _ t y p e d e f , name: "__builtin_va_list" , line: 6 , file: !1 , baseType: !18 )
!18 = !DICompositeType ( tag: D W _ T A G _ s t r u c t u r e _ type , name: "__va_list" , line: 6 , size: 32 , align: 32 , file: !1 , elements: !19 )
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-15 20:07:53 +01:00
!19 = ! { !20 }
2015-04-29 18:38:44 +02:00
!20 = !DIDerivedType ( tag: D W _ T A G _ m e m b e r , name: "__ap" , line: 6 , size: 32 , align: 32 , file: !1 , scope: !18 , baseType: !21 )
!21 = !DIDerivedType ( tag: D W _ T A G _ p o i n t e r _ type , size: 32 , align: 32 , baseType: null )
!22 = !DILocation ( line: 6 , scope: !4 )
!23 = !DILocation ( line: 7 , scope: !4 )
2015-07-31 20:58:39 +02:00
!24 = !DILocalVariable ( name: "test_basic" , line: 8 , scope: !4 , file: !5 , type: !8 )
2015-04-29 18:38:44 +02:00
!25 = !DILocation ( line: 8 , scope: !4 )
2015-07-31 20:58:39 +02:00
!26 = !DILocalVariable ( name: "i" , line: 9 , scope: !27 , file: !5 , type: !8 )
2015-04-29 18:38:44 +02:00
!27 = distinct !DILexicalBlock ( line: 9 , column: 0 , file: !1 , scope: !4 )
!28 = !DILocation ( line: 9 , scope: !27 )
!29 = !DILocation ( line: 10 , scope: !30 )
!30 = distinct !DILexicalBlock ( line: 9 , column: 0 , file: !1 , scope: !27 )
!31 = !DILocation ( line: 11 , scope: !30 )
!32 = !DILocation ( line: 12 , scope: !4 )
!33 = !DILocation ( line: 13 , scope: !4 )
2014-04-02 18:10:33 +02:00
; Just to prevent the alloca from being optimized away
declare void @dummy_use ( i32 * , i32 )
2014-04-11 00:58:43 +02:00
attributes #0 = { "split-stack" }