mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-02 22:23:10 +00:00
Fix debug info in these tests, which started failing with a WIP patch to
verify compile units and types. The problems look like they were all
caused by bitrot. They fell into these categories:
- Using `!{i32 0}` instead of `!{}`.
- Using `!{null}` instead of `!{}`.
- Using `!MDExpression()` instead of `!{}`.
- Using `!8` instead of `!{!8}`.
- `file:` references that pointed at `MDCompileUnit`s instead of the
same `MDFile` as the compile unit.
- `file:` references that were numerically off-by-one or (off-by-ten).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233415 91177308-0d34-0410-b5e6-96231b3b80d8
57 lines
2.8 KiB
LLVM
57 lines
2.8 KiB
LLVM
; RUN: opt < %s -S -inline -inline-threshold=2 | FileCheck %s
|
|
; RUN: opt < %s -S -strip-debug -inline -inline-threshold=2 | FileCheck %s
|
|
;
|
|
; The purpose of this test is to check that debug info doesn't influence
|
|
; inlining decisions.
|
|
|
|
target 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"
|
|
target triple = "x86_64-unknown-linux-gnu"
|
|
|
|
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
|
|
declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #1
|
|
|
|
define <4 x float> @inner_vectors(<4 x float> %a, <4 x float> %b) {
|
|
entry:
|
|
call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !6), metadata !MDExpression())
|
|
%mul = fmul <4 x float> %a, <float 3.000000e+00, float 3.000000e+00, float 3.000000e+00, float 3.000000e+00>
|
|
call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !6), metadata !MDExpression())
|
|
%mul1 = fmul <4 x float> %b, <float 5.000000e+00, float 5.000000e+00, float 5.000000e+00, float 5.000000e+00>
|
|
call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !6), metadata !MDExpression())
|
|
%add = fadd <4 x float> %mul, %mul1
|
|
ret <4 x float> %add
|
|
}
|
|
|
|
define float @outer_vectors(<4 x float> %a, <4 x float> %b) {
|
|
; CHECK-LABEL: @outer_vectors(
|
|
; CHECK-NOT: call <4 x float> @inner_vectors(
|
|
; CHECK: ret float
|
|
|
|
entry:
|
|
call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !6), metadata !MDExpression())
|
|
call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !6), metadata !MDExpression())
|
|
%call = call <4 x float> @inner_vectors(<4 x float> %a, <4 x float> %b)
|
|
call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !6), metadata !MDExpression())
|
|
%vecext = extractelement <4 x float> %call, i32 0
|
|
%vecext1 = extractelement <4 x float> %call, i32 1
|
|
%add = fadd float %vecext, %vecext1
|
|
%vecext2 = extractelement <4 x float> %call, i32 2
|
|
%add3 = fadd float %add, %vecext2
|
|
%vecext4 = extractelement <4 x float> %call, i32 3
|
|
%add5 = fadd float %add3, %vecext4
|
|
ret float %add5
|
|
}
|
|
|
|
attributes #0 = { nounwind readnone }
|
|
|
|
!llvm.dbg.cu = !{!0}
|
|
!llvm.module.flags = !{!3, !4}
|
|
!llvm.ident = !{!5}
|
|
|
|
!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !{!6}, globals: !2, imports: !2)
|
|
!1 = !MDFile(filename: "test.c", directory: "")
|
|
!2 = !{}
|
|
!3 = !{i32 2, !"Dwarf Version", i32 4}
|
|
!4 = !{i32 1, !"Debug Info Version", i32 3}
|
|
!5 = !{!""}
|
|
!6 = !MDSubprogram()
|