brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · d9c982a Raw
47 lines · plain
1; RUN: opt -S -passes=licm %s | FileCheck %s2;3; LICM should null out debug locations when it hoists intrinsics that won't lower to function calls out of a loop.4; CHECK: define float @foo5; CHECK-NEXT: entry:6; CHECK-NEXT: call float @llvm.fma.f32(float %coef_0, float %coef_1, float 0.000000e+00){{$}}7; CHECK-NEXT: br label %loop.header8;9define float @foo(ptr %A, float %coef_0, float %coef_1, i32 %n) !dbg !2 {10entry:11  br label %loop.header12 13loop.header:14  %i = phi i32 [ 0, %entry ], [ %i.inc, %loop.backedge ]15  %a = phi float [ 0.000000e+00, %entry ], [ %a.inc, %loop.backedge ]16  %cond = icmp ult i32 %i, %n17  br i1 %cond, label %loop.backedge, label %exit18 19loop.backedge:20  %i.cast = zext i32 %i to i6421  %A.ptr = getelementptr inbounds float, ptr %A, i64 %i.cast22  %A.load = load float, ptr %A.ptr23  %fma = call float @llvm.fma.f32(float %coef_0, float %coef_1, float 0.000000e+00), !dbg !324  %mul = fmul float %fma, %A.load25  %a.inc = fadd float %mul, %a26  %i.inc = add i32 %i, 127  br label %loop.header28 29exit:30  ret float %a31}32 33declare float @llvm.fma.f32(float, float, float) #134 35attributes #0 = { nofree nosync nounwind readnone speculatable willreturn }36 37!llvm.dbg.cu = !{!0}38!llvm.module.flags = !{!6}39 40!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 14", isOptimized: false, runtimeVersion: 0, emissionKind: LineTablesOnly, splitDebugInlining: false, nameTableKind: None)41!1 = !DIFile(filename: "source.c", directory: "/")42!2 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !4, scopeLine: 1, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !5)43!3 = !DILocation(line: 4, column: 17, scope: !2)44!4 = !DISubroutineType(types: !5)45!5 = !{}46!6 = !{i32 2, !"Debug Info Version", i32 3}47