brintos

brintos / llvm-project-archived public Read only

0
0
Text · 5.4 KiB · 6fe93f0 Raw
136 lines · plain
1# RUN: llc -run-pass=early-tailduplication -mtriple=x86_64-unknown-linux-gnu %s -o - | FileCheck %s2 3# Tail Duplication may update SSA values and invalidate any DBG_VALUEs that4# use those values; those DBG_VALUEs should be set undef. This is tested5# for DBG_VALUE users, and DBG_VALUE_LISTs that use the value multiple times.6 7# CHECK: ![[VAR_J:[0-9]+]] = !DILocalVariable(name: "j"8# CHECK: ![[VAR_K:[0-9]+]] = !DILocalVariable(name: "k"9# CHECK-LABEL: bb.1.L:10# CHECK: %[[REGISTER:[0-9]+]]:gr32 = PHI11# CHECK-LABEL: bb.2.if.end4:12# CHECK: DBG_VALUE_LIST ![[VAR_J]],13# CHECK-SAME: %[[REGISTER]], 1, %[[REGISTER]]14# CHECK: DBG_VALUE %[[REGISTER]], $noreg, ![[VAR_K]]15 16--- |17  target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"18  target triple = "x86_64-unknown-linux-gnu"19  20  define dso_local void @main() local_unnamed_addr #0 !dbg !15 {21  entry:22    br label %L.outer23  24  L:                                                ; preds = %L, %L.outer25    %tobool2.not = icmp eq i32 undef, 026    br i1 %tobool2.not, label %if.end4, label %L27  28  if.end4:                                          ; preds = %L29    call void @llvm.dbg.value(metadata !DIArgList(i32 %f.0.ph, i32 1, i32 %f.0.ph), metadata !19, metadata !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_arg, 1, DW_OP_LLVM_arg, 2, DW_OP_and, DW_OP_or, DW_OP_stack_value)), !dbg !2130    %cmp = icmp slt i32 %f.0.ph, undef31    br i1 %cmp, label %if.then5, label %if.end632  33  if.then5:                                         ; preds = %if.end434    call void @h() #235    br label %L.outer36  37  L.outer:                                          ; preds = %if.then5, %entry38    %f.0.ph = phi i32 [ 0, %if.then5 ], [ 1, %entry ]39    br label %L40  41  if.end6:                                          ; preds = %if.end442    ret void43  }44  45  declare dso_local void @h() local_unnamed_addr46  47  declare void @llvm.dbg.value(metadata, metadata, metadata)48  49  !llvm.dbg.cu = !{!0}50  !llvm.module.flags = !{!13, !14}51  52  !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 13.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, globals: !3, splitDebugInlining: false, nameTableKind: None)53  !1 = !DIFile(filename: "tail-dup-debugvalue.c", directory: "/tmp")54  !2 = !{}55  !3 = !{!4, !7, !9, !11}56  !4 = !DIGlobalVariableExpression(var: !5, expr: !DIExpression())57  !5 = distinct !DIGlobalVariable(name: "a", scope: !0, file: !1, line: 2, type: !6, isLocal: false, isDefinition: true)58  !6 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)59  !7 = !DIGlobalVariableExpression(var: !8, expr: !DIExpression())60  !8 = distinct !DIGlobalVariable(name: "b", scope: !0, file: !1, line: 2, type: !6, isLocal: false, isDefinition: true)61  !9 = !DIGlobalVariableExpression(var: !10, expr: !DIExpression())62  !10 = distinct !DIGlobalVariable(name: "c", scope: !0, file: !1, line: 2, type: !6, isLocal: false, isDefinition: true)63  !11 = !DIGlobalVariableExpression(var: !12, expr: !DIExpression())64  !12 = distinct !DIGlobalVariable(name: "d", scope: !0, file: !1, line: 2, type: !6, isLocal: false, isDefinition: true)65  !13 = !{i32 2, !"Debug Info Version", i32 3}66  !14 = !{i32 7, !"uwtable", i32 1}67  !15 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 3, type: !16, scopeLine: 3, flags: DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !18)68  !16 = !DISubroutineType(types: !17)69  !17 = !{!6}70  !18 = !{!19, !20}71  !19 = !DILocalVariable(name: "j", scope: !15, file: !1, line: 14, type: !6)72  !20 = !DILocalVariable(name: "k", scope: !15, file: !1, line: 14, type: !6)73  !21 = !DILocation(line: 0, scope: !15)74 75...76---77name:            main78alignment:       1679tracksRegLiveness: true80registers:81  - { id: 0, class: gr32 }82  - { id: 1, class: gr32 }83  - { id: 2, class: gr32 }84  - { id: 3, class: gr8 }85  - { id: 4, class: gr32 }86  - { id: 5, class: gr32 }87  - { id: 6, class: gr32 }88frameInfo:89  maxAlignment:    190  hasCalls:        true91machineFunctionInfo: {}92body:             |93  bb.0.entry:94    successors: %bb.4(0x80000000)95  96    %1:gr32 = MOV32ri 197    JMP_1 %bb.498  99  bb.1.L:100    successors: %bb.2(0x04000000), %bb.1(0x7c000000)101  102    %2:gr32 = MOV32r0 implicit-def dead $eflags103    %3:gr8 = COPY %2.sub_8bit104    TEST8rr %3, %3, implicit-def $eflags105    JCC_1 %bb.1, 5, implicit $eflags106    JMP_1 %bb.2107  108  bb.2.if.end4:109    successors: %bb.3(0x783e0f0f), %bb.5(0x07c1f0f1)110  111    DBG_VALUE_LIST !19, !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_arg, 1, DW_OP_LLVM_arg, 2, DW_OP_and, DW_OP_or, DW_OP_stack_value), %0, 1, %0, debug-location !21112    DBG_VALUE %0, $noreg, !20, !DIExpression(), debug-location !21113    %5:gr32 = IMPLICIT_DEF114    %4:gr32 = SUB32rr %0, killed %5, implicit-def $eflags115    JCC_1 %bb.5, 13, implicit $eflags116    JMP_1 %bb.3117  118  bb.3.if.then5:119    successors: %bb.4(0x80000000)120  121    ADJCALLSTACKDOWN64 0, 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp122    CALL64pcrel32 @h, csr_64, implicit $rsp, implicit $ssp, implicit-def $rsp, implicit-def $ssp123    ADJCALLSTACKUP64 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp124    %6:gr32 = MOV32r0 implicit-def dead $eflags125  126  bb.4.L.outer:127    successors: %bb.1(0x80000000)128  129    %0:gr32 = PHI %1, %bb.0, %6, %bb.3130    JMP_1 %bb.1131  132  bb.5.if.end6:133    RET 0134 135...136