brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · 87826bb Raw
55 lines · plain
1; RUN: opt -passes=hotcoldsplit -hotcoldsplit-threshold=0 -S < %s | FileCheck %s2 3target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"4target triple = "x86_64-unknown-linux-gnu"5 6define void @foo(i32 %a, i32 %b) !dbg !2 {7entry:8   %1 = alloca i32, i64 1, align 49   %2 = alloca i32, i64 1, align 410   store i32 %a, ptr %1, align 411   #dbg_declare(ptr %1, !8, !DIExpression(), !1)12   #dbg_value(i32 %b, !9, !DIExpression(), !1)13   %tobool = icmp eq i32 %a, 014   br i1 %tobool, label %if.then, label %if.end15if.then:                                          ; preds = %entry16  ret void17 18if.end:                                           ; preds = %entry19   store i32 10, ptr %1, align 420   %3 = add i32 %b, 121   store i32 1, ptr %2, align 422   call void @sink(i32 %3)23   #dbg_declare(ptr %2, !10, !DIExpression(), !1)24   ret void25}26 27declare void @sink(i32) cold28 29!llvm.dbg.cu = !{!6}30!llvm.module.flags = !{!0}31!0 = !{i32 2, !"Debug Info Version", i32 3}32!1 = !DILocation(line: 11, column: 7, scope: !2)33!2 = distinct !DISubprogram(name: "foo", scope: !3, file: !3, type: !4, spFlags: DISPFlagDefinition, unit: !6)34!3 = !DIFile(filename: "test.c", directory: "")35!4 = !DISubroutineType(cc: DW_CC_program, types: !5)36!5 = !{}37!6 = distinct !DICompileUnit(language: DW_LANG_C, file: !3)38!7 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)39!8 = !DILocalVariable(name: "a", scope: !2, file: !3, type: !7)40!9 = !DILocalVariable(name: "b", scope: !2, file: !3, type: !7)41!10 = !DILocalVariable(name: "c", scope: !2, file: !3, type: !7)42 43; CHECK: define {{.*}}@foo.cold.1(ptr %[[ARG0:.*]], i32 %[[ARG1:.*]], ptr %[[ARG2:.*]]){{.*}} !dbg ![[FN:.*]] {44; CHECK-NEXT: newFuncRoot:45; CHECK-NEXT: #dbg_declare(ptr %[[ARG0]], ![[V1:[0-9]+]], {{.*}})46; CHECK-NEXT: #dbg_value(i32 %[[ARG1]], ![[V2:[0-9]+]], {{.*}})47; CHECK-NEXT: br48; CHECK: if.end:49; CHECK:     #dbg_declare(ptr %[[ARG2]], ![[V3:[0-9]+]], {{.*}})50; CHECK: }51 52; CHECK: ![[V1]] = !DILocalVariable(name: "a", scope: ![[FN]]{{.*}})53; CHECK: ![[V2]] = !DILocalVariable(name: "b", scope: ![[FN]]{{.*}})54; CHECK: ![[V3]] = !DILocalVariable(name: "c", scope: ![[FN]]{{.*}})55