brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.0 KiB · 7ccf7e8 Raw
59 lines · plain
1; RUN: opt < %s -S -passes=inline -inline-threshold=2 | FileCheck %s2; RUN: opt < %s -S -strip-debug -passes=inline -inline-threshold=2 | FileCheck %s3; RUN: opt < %s -S -passes='cgscc(inline)' -inline-threshold=2 | FileCheck %s4; RUN: opt < %s -S -strip-debug -passes='cgscc(inline)' -inline-threshold=2 | FileCheck %s5;6; The purpose of this test is to check that debug info doesn't influence7; inlining decisions.8 9target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"10target triple = "x86_64-unknown-linux-gnu"11 12declare void @llvm.dbg.declare(metadata, metadata, metadata) #113declare void @llvm.dbg.value(metadata, metadata, metadata) #114 15define <4 x float> @inner_vectors(<4 x float> %a, <4 x float> %b) {16entry:17  call void @llvm.dbg.value(metadata i32 undef, metadata !DILocalVariable(scope: !6), metadata !DIExpression()), !dbg !DILocation(scope: !6)18  %mul = fmul <4 x float> %a, <float 3.000000e+00, float 3.000000e+00, float 3.000000e+00, float 3.000000e+00>19  call void @llvm.dbg.value(metadata i32 undef, metadata !DILocalVariable(scope: !6), metadata !DIExpression()), !dbg !DILocation(scope: !6)20  %mul1 = fmul <4 x float> %b, <float 5.000000e+00, float 5.000000e+00, float 5.000000e+00, float 5.000000e+00>21  call void @llvm.dbg.value(metadata i32 undef, metadata !DILocalVariable(scope: !6), metadata !DIExpression()), !dbg !DILocation(scope: !6)22  %add = fadd <4 x float> %mul, %mul123  ret <4 x float> %add24}25 26define float @outer_vectors(<4 x float> %a, <4 x float> %b) {27; CHECK-LABEL: @outer_vectors(28; CHECK-NOT: call <4 x float> @inner_vectors(29; CHECK: ret float30 31entry:32  call void @llvm.dbg.value(metadata i32 undef, metadata !DILocalVariable(scope: !6), metadata !DIExpression()), !dbg !DILocation(scope: !6)33  call void @llvm.dbg.value(metadata i32 undef, metadata !DILocalVariable(scope: !6), metadata !DIExpression()), !dbg !DILocation(scope: !6)34  %call = call <4 x float> @inner_vectors(<4 x float> %a, <4 x float> %b)35  call void @llvm.dbg.value(metadata i32 undef, metadata !DILocalVariable(scope: !6), metadata !DIExpression()), !dbg !DILocation(scope: !6)36  %vecext = extractelement <4 x float> %call, i32 037  %vecext1 = extractelement <4 x float> %call, i32 138  %add = fadd float %vecext, %vecext139  %vecext2 = extractelement <4 x float> %call, i32 240  %add3 = fadd float %add, %vecext241  %vecext4 = extractelement <4 x float> %call, i32 342  %add5 = fadd float %add3, %vecext443  ret float %add544}45 46attributes #0 = { nounwind readnone }47 48!llvm.dbg.cu = !{!0}49!llvm.module.flags = !{!3, !4}50!llvm.ident = !{!5}51 52!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)53!1 = !DIFile(filename: "test.c", directory: "")54!2 = !{}55!3 = !{i32 2, !"Dwarf Version", i32 4}56!4 = !{i32 1, !"Debug Info Version", i32 3}57!5 = !{!""}58!6 = distinct !DISubprogram(unit: !0)59