| 1 |
; RUN: opt -S %s -passes='function(instcombine),sample-profile' -sample-profile-file=%S/Inputs/inline-combine.prof | FileCheck %s |
| 2 |
; RUN: opt -S %s -passes="function(instcombine),sample-profile" -sample-profile-file=%S/Inputs/inline-combine.prof | FileCheck %s |
| 3 |
|
| 4 |
%"class.llvm::FoldingSetNodeID" = type { %"class.llvm::SmallVector" } |
| 5 |
%"class.llvm::SmallVector" = type { %"class.llvm::SmallVectorImpl.base", %"struct.llvm::SmallVectorStorage" } |
| 6 |
%"class.llvm::SmallVectorImpl.base" = type { %"class.llvm::SmallVectorTemplateBase.base" } |
| 7 |
%"class.llvm::SmallVectorTemplateBase.base" = type { %"class.llvm::SmallVectorTemplateCommon.base" } |
| 8 |
%"class.llvm::SmallVectorTemplateCommon.base" = type <{ %"class.llvm::SmallVectorBase", %"struct.llvm::AlignedCharArrayUnion" }> |
| 9 |
%"class.llvm::SmallVectorBase" = type { ptr, ptr, ptr } |
| 10 |
%"struct.llvm::AlignedCharArrayUnion" = type { %"struct.llvm::AlignedCharArray" } |
| 11 |
%"struct.llvm::AlignedCharArray" = type { [4 x i8] } |
| 12 |
%"struct.llvm::SmallVectorStorage" = type { [31 x %"struct.llvm::AlignedCharArrayUnion"] } |
| 13 |
%"class.llvm::SmallVectorImpl" = type { %"class.llvm::SmallVectorTemplateBase.base", [4 x i8] } |
| 14 |
|
| 15 |
$foo = comdat any |
| 16 |
|
| 17 |
$bar = comdat any |
| 18 |
|
| 19 |
define void @foo(ptr %this) #0 align 2 !dbg !3 { |
| 20 |
%1 = alloca ptr, align 8 |
| 21 |
store ptr %this, ptr %1, align 8 |
| 22 |
%2 = load ptr, ptr %1, align 8 |
| 23 |
; the call should have been inlined after sample-profile pass |
| 24 |
; CHECK-NOT: call void |
| 25 |
call void @bar(ptr %2), !dbg !7 |
| 26 |
ret void |
| 27 |
} |
| 28 |
|
| 29 |
define void @bar(ptr %this) #0 align 2 !dbg !8 { |
| 30 |
ret void |
| 31 |
} |
| 32 |
|
| 33 |
attributes #0 = { "comdat" "use-sample-profile" } |
| 34 |
|
| 35 |
!llvm.module.flags = !{!0, !1} |
| 36 |
!llvm.ident = !{!2} |
| 37 |
!llvm.dbg.cu = !{!9} |
| 38 |
|
| 39 |
!0 = !{i32 2, !"Dwarf Version", i32 4} |
| 40 |
!1 = !{i32 1, !"Debug Info Version", i32 3} |
| 41 |
!2 = !{!"clang version 3.5 "} |
| 42 |
!3 = distinct !DISubprogram(name: "foo", scope: !4, file: !4, line: 3, type: !5, isLocal: false, isDefinition: true, scopeLine: 3, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !9, retainedNodes: !6) |
| 43 |
!4 = !DIFile(filename: "test.cc", directory: ".") |
| 44 |
!5 = !DISubroutineType(types: !6) |
| 45 |
!6 = !{} |
| 46 |
!7 = !DILocation(line: 4, scope: !3) |
| 47 |
!8 = distinct !DISubprogram(name: "bar", scope: !4, file: !4, line: 7, type: !5, isLocal: false, isDefinition: true, scopeLine: 7, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !9, retainedNodes: !6) |
| 48 |
!9 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5 ", isOptimized: false, emissionKind: FullDebug, file: !4) |