2013-07-30 04:18:19 +08:00
|
|
|
; RUN: opt -licm -basicaa < %s -S | FileCheck %s
|
2017-01-11 12:39:35 +08:00
|
|
|
; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<targetir>,require<scalar-evolution>,require<opt-remark-emit>,loop(licm)' < %s -S | FileCheck %s
|
2011-03-08 11:06:19 +08:00
|
|
|
|
|
|
|
define void @dgefa() nounwind ssp {
|
|
|
|
entry:
|
|
|
|
br label %for.body
|
|
|
|
|
|
|
|
for.body: ; preds = %for.cond.backedge, %entry
|
|
|
|
br i1 undef, label %if.then, label %for.cond.backedge, !dbg !11
|
|
|
|
|
|
|
|
for.cond.backedge: ; preds = %for.body61, %for.body61.us, %for.body
|
|
|
|
br i1 undef, label %for.end104, label %for.body, !dbg !15
|
|
|
|
|
|
|
|
if.then: ; preds = %for.body
|
|
|
|
br i1 undef, label %if.then27, label %if.end.if.end.split_crit_edge.critedge, !dbg !16
|
|
|
|
|
|
|
|
if.then27: ; preds = %if.then
|
|
|
|
; CHECK: tail call void @llvm.dbg.value
|
2017-07-29 04:21:02 +08:00
|
|
|
tail call void @llvm.dbg.value(metadata double undef, metadata !19, metadata !DIExpression()), !dbg !21
|
2011-03-08 11:06:19 +08:00
|
|
|
br label %for.body61.us
|
|
|
|
|
|
|
|
if.end.if.end.split_crit_edge.critedge: ; preds = %if.then
|
|
|
|
br label %for.body61
|
|
|
|
|
|
|
|
for.body61.us: ; preds = %for.body61.us, %if.then27
|
|
|
|
br i1 undef, label %for.cond.backedge, label %for.body61.us, !dbg !23
|
|
|
|
|
|
|
|
for.body61: ; preds = %for.body61, %if.end.if.end.split_crit_edge.critedge
|
|
|
|
br i1 undef, label %for.cond.backedge, label %for.body61, !dbg !23
|
|
|
|
|
|
|
|
for.end104: ; preds = %for.cond.backedge
|
|
|
|
ret void, !dbg !24
|
|
|
|
}
|
|
|
|
|
2017-07-29 04:21:02 +08:00
|
|
|
declare void @llvm.dbg.value(metadata, metadata, metadata) nounwind readnone
|
2011-03-08 11:06:19 +08:00
|
|
|
|
2013-11-23 09:16:29 +08:00
|
|
|
!llvm.module.flags = !{!26}
|
2016-03-30 06:34:30 +08:00
|
|
|
!llvm.dbg.cu = !{!2}
|
2011-03-08 11:06:19 +08:00
|
|
|
|
2016-04-15 23:57:41 +08:00
|
|
|
!0 = distinct !DISubprogram(name: "idamax", line: 112, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !2, file: !25, scope: !1, type: !3)
|
2015-04-30 00:38:44 +08:00
|
|
|
!1 = !DIFile(filename: "/Volumes/Lalgate/work/llvm/projects/llvm-test/SingleSource/Benchmarks/CoyoteBench/lpbench.c", directory: "/private/tmp")
|
2016-04-15 23:57:41 +08:00
|
|
|
!2 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 2.9 (trunk 127169)", isOptimized: true, emissionKind: FullDebug, file: !25)
|
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 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
|
2016-04-15 23:57:41 +08:00
|
|
|
!6 = distinct !DISubprogram(name: "dscal", line: 206, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !2, file: !25, scope: !1, type: !7)
|
2016-03-30 06:34:30 +08:00
|
|
|
!7 = !DISubroutineType(types: !{null})
|
2016-04-15 23:57:41 +08:00
|
|
|
!9 = distinct !DISubprogram(name: "daxpy", line: 230, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !2, file: !25, scope: !1, type: !7)
|
|
|
|
!10 = distinct !DISubprogram(name: "dgefa", line: 267, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !2, file: !25, scope: !1, type: !7)
|
2015-04-30 00:38:44 +08:00
|
|
|
!11 = !DILocation(line: 281, column: 9, scope: !12)
|
|
|
|
!12 = distinct !DILexicalBlock(line: 272, column: 5, file: !25, scope: !13)
|
|
|
|
!13 = distinct !DILexicalBlock(line: 271, column: 5, file: !25, scope: !14)
|
|
|
|
!14 = distinct !DILexicalBlock(line: 267, column: 1, file: !25, scope: !10)
|
|
|
|
!15 = !DILocation(line: 271, column: 5, scope: !14)
|
|
|
|
!16 = !DILocation(line: 284, column: 10, scope: !17)
|
|
|
|
!17 = distinct !DILexicalBlock(line: 282, column: 9, file: !25, scope: !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
|
|
|
!18 = !{double undef}
|
2015-08-01 02:58:39 +08:00
|
|
|
!19 = !DILocalVariable(name: "temp", line: 268, scope: !14, file: !1, type: !20)
|
2015-04-30 00:38:44 +08:00
|
|
|
!20 = !DIBasicType(tag: DW_TAG_base_type, name: "double", size: 64, align: 64, encoding: DW_ATE_float)
|
|
|
|
!21 = !DILocation(line: 286, column: 14, scope: !22)
|
|
|
|
!22 = distinct !DILexicalBlock(line: 285, column: 13, file: !25, scope: !17)
|
|
|
|
!23 = !DILocation(line: 296, column: 13, scope: !17)
|
|
|
|
!24 = !DILocation(line: 313, column: 1, scope: !14)
|
|
|
|
!25 = !DIFile(filename: "/Volumes/Lalgate/work/llvm/projects/llvm-test/SingleSource/Benchmarks/CoyoteBench/lpbench.c", directory: "/private/tmp")
|
2015-03-04 01:24:31 +08:00
|
|
|
!26 = !{i32 1, !"Debug Info Version", i32 3}
|