62 lines · plain
1; RUN: opt %s -passes='require<profile-summary>,function(select-optimize)' -o - -S \2; RUN: | FileCheck %s3 4;; Check that the dbg.value is moved into the start of the end-block of the5;; inserted if-block.6 7; CHECK: select.end:8; CHECK-NEXT: %[[PHI:.*]] = phi i329; CHECK-NEXT: #dbg_value(i32 %[[PHI]],10 11source_filename = "test.ll"12target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"13target triple = "aarch64-unknown-fuchsia"14 15%struct.hb_glyph_info_t = type { i32, i32, i32, %union._hb_var_int_t, %union._hb_var_int_t }16%union._hb_var_int_t = type { i32 }17 18define void @_Z22_hb_ot_shape_normalizePK18hb_ot_shape_plan_tP11hb_buffer_tP9hb_font_t() {19entry:20 br label %while.body19321 22while.body193: ; preds = %while.body193, %entry23 %starter.0337 = phi i32 [ %spec.select322, %while.body193 ], [ 0, %entry ]24 %idxprom207 = zext i32 %starter.0337 to i6425 %arrayidx208 = getelementptr %struct.hb_glyph_info_t, ptr null, i64 %idxprom20726 %0 = load i32, ptr %arrayidx208, align 427 %call247.val = load i16, ptr null, align 428 %cmp249327 = icmp ult i16 %call247.val, 029 %cmp249 = select i1 false, i1 false, i1 %cmp24932730 %spec.select322 = select i1 %cmp249, i32 0, i32 %starter.033731 tail call void @llvm.dbg.value(metadata i32 %spec.select322, metadata !13, metadata !DIExpression()), !dbg !2032 br label %while.body19333}34 35declare void @llvm.dbg.value(metadata, metadata, metadata)36 37 38!llvm.dbg.cu = !{!0}39!llvm.module.flags = !{!12}40 41!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !2, globals: !3, imports: !2, splitDebugInlining: false, nameTableKind: GNU)42!1 = !DIFile(filename: "../../third_party/harfbuzz-ng/src/src/hb-ot-shape-normalize.cc", directory: ".")43!2 = !{}44!3 = !{!4, !9}45!4 = !DIGlobalVariableExpression(var: !5, expr: !DIExpression())46!5 = distinct !DIGlobalVariable(scope: null, file: !1, line: 383, type: !6, isLocal: true, isDefinition: true)47!6 = !DICompositeType(tag: DW_TAG_array_type, baseType: !7, size: 112, elements: !2)48!7 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !8)49!8 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_unsigned_char)50!9 = !DIGlobalVariableExpression(var: !10, expr: !DIExpression())51!10 = distinct !DIGlobalVariable(scope: null, file: !1, line: 410, type: !11, isLocal: true, isDefinition: true)52!11 = !DICompositeType(tag: DW_TAG_array_type, baseType: !7, size: 96, elements: !2)53!12 = !{i32 2, !"Debug Info Version", i32 3}54!13 = !DILocalVariable(name: "starter", scope: !14, file: !1, line: 441, type: !19)55!14 = distinct !DILexicalBlock(scope: !15, file: !1, line: 435, column: 3)56!15 = distinct !DILexicalBlock(scope: !16, file: !1, line: 431, column: 7)57!16 = distinct !DISubprogram(name: "_hb_ot_shape_normalize", linkageName: "_Z22_hb_ot_shape_normalizePK18hb_ot_shape_plan_tP11hb_buffer_tP9hb_font_t", scope: !1, file: !1, line: 291, type: !17, scopeLine: 294, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !2)58!17 = distinct !DISubroutineType(types: !18)59!18 = !{null}60!19 = !DIBasicType(name: "unsigned int", size: 32, encoding: DW_ATE_unsigned)61!20 = !DILocation(line: 0, scope: !14)62