145 lines · plain
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 32# RUN: llc --aarch64-enable-sink-fold=true --run-pass=machine-sink %s -o - | FileCheck %s3--- |4 source_filename = "dbg.c"5 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"6 target triple = "aarch64-unknown-linux"7 8 define dso_local void @g(i32 noundef %x) local_unnamed_addr !dbg !11 {9 entry:10 call void @llvm.dbg.value(metadata i32 %x, metadata !16, metadata !DIExpression()), !dbg !2011 %add = add nsw i32 %x, 1, !dbg !2112 call void @llvm.dbg.value(metadata i32 %add, metadata !17, metadata !DIExpression()), !dbg !2013 call void @llvm.dbg.value(metadata i32 %add, metadata !18, metadata !DIExpression()), !dbg !2014 %call = tail call i32 @f(i32 noundef %add), !dbg !2215 call void @llvm.dbg.value(metadata i32 %add, metadata !19, metadata !DIExpression()), !dbg !2016 %call1 = tail call i32 @f(i32 noundef %add), !dbg !2317 ret void, !dbg !2418 }19 20 declare !dbg !25 i32 @f(i32 noundef)21 22 declare void @llvm.dbg.value(metadata, metadata, metadata)23 24 !llvm.dbg.cu = !{!0}25 !llvm.module.flags = !{!2, !3, !4, !5, !6, !7, !8, !9}26 !llvm.ident = !{!10}27 28 !0 = distinct !DICompileUnit(language: DW_LANG_C11, file: !1, producer: "clang version 18.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None)29 !1 = !DIFile(filename: "dbg.c", directory: "/home/sweet", checksumkind: CSK_MD5, checksum: "b6bd7ad2140c696af9201a17ab73c918")30 !2 = !{i32 7, !"Dwarf Version", i32 5}31 !3 = !{i32 2, !"Debug Info Version", i32 3}32 !4 = !{i32 1, !"wchar_size", i32 4}33 !5 = !{i32 8, !"PIC Level", i32 2}34 !6 = !{i32 7, !"PIE Level", i32 2}35 !7 = !{i32 7, !"uwtable", i32 2}36 !8 = !{i32 7, !"frame-pointer", i32 1}37 !9 = !{i32 7, !"debug-info-assignment-tracking", i1 true}38 !10 = !{!"clang version 18.0.0"}39 !11 = distinct !DISubprogram(name: "g", scope: !1, file: !1, line: 3, type: !12, scopeLine: 3, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !15)40 !12 = !DISubroutineType(types: !13)41 !13 = !{null, !14}42 !14 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)43 !15 = !{!16, !17, !18, !19}44 !16 = !DILocalVariable(name: "x", arg: 1, scope: !11, file: !1, line: 3, type: !14)45 !17 = !DILocalVariable(name: "y", scope: !11, file: !1, line: 4, type: !14)46 !18 = !DILocalVariable(name: "t0", scope: !11, file: !1, line: 6, type: !14)47 !19 = !DILocalVariable(name: "t1", scope: !11, file: !1, line: 9, type: !14)48 !20 = !DILocation(line: 0, scope: !11)49 !21 = !DILocation(line: 4, column: 13, scope: !11)50 !22 = !DILocation(line: 7, column: 3, scope: !11)51 !23 = !DILocation(line: 10, column: 3, scope: !11)52 !24 = !DILocation(line: 11, column: 1, scope: !11)53 !25 = !DISubprogram(name: "f", scope: !1, file: !1, line: 1, type: !26, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized)54 !26 = !DISubroutineType(types: !27)55 !27 = !{!14, !14}56 57...58---59name: g60alignment: 461exposesReturnsTwice: false62legalized: false63regBankSelected: false64selected: false65failedISel: false66tracksRegLiveness: true67hasWinCFI: false68callsEHReturn: false69callsUnwindInit: false70hasEHContTarget: false71hasEHScopes: false72hasEHFunclets: false73isOutlined: false74debugInstrRef: false75failsVerification: false76tracksDebugUserValues: false77registers:78 - { id: 0, class: gpr32common, preferred-register: '' }79 - { id: 1, class: gpr32sp, preferred-register: '' }80 - { id: 2, class: gpr32all, preferred-register: '' }81liveins:82 - { reg: '$w0', virtual-reg: '%0' }83frameInfo:84 isFrameAddressTaken: false85 isReturnAddressTaken: false86 hasStackMap: false87 hasPatchPoint: false88 stackSize: 089 offsetAdjustment: 090 maxAlignment: 191 adjustsStack: true92 hasCalls: true93 stackProtector: ''94 functionContext: ''95 maxCallFrameSize: 096 cvBytesOfCalleeSavedRegisters: 097 hasOpaqueSPAdjustment: false98 hasVAStart: false99 hasMustTailInVarArgFunc: false100 hasTailCall: true101 localFrameSize: 0102 savePoint: []103 restorePoint: []104fixedStack: []105stack: []106entry_values: []107callSites: []108debugValueSubstitutions: []109constants: []110machineFunctionInfo: {}111body: |112 bb.0.entry:113 liveins: $w0114 115 ; CHECK-LABEL: name: g116 ; CHECK: liveins: $w0117 ; CHECK-NEXT: {{ $}}118 ; CHECK-NEXT: DBG_VALUE $w0, $noreg, !16, !DIExpression(), debug-location !20119 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr32common = COPY $w0120 ; CHECK-NEXT: DBG_VALUE [[COPY]], $noreg, !16, !DIExpression(), debug-location !20121 ; CHECK-NEXT: DBG_VALUE $noreg, $noreg, !17, !DIExpression(), debug-location !20122 ; CHECK-NEXT: DBG_VALUE $noreg, $noreg, !18, !DIExpression(), debug-location !20123 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp, debug-location !22124 ; CHECK-NEXT: $w0 = nsw ADDWri [[COPY]], 1, 0, debug-location !21125 ; CHECK-NEXT: BL @f, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit $w0, implicit-def $sp, implicit-def $w0, debug-location !22126 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp, debug-location !22127 ; CHECK-NEXT: DBG_VALUE $noreg, $noreg, !19, !DIExpression(), debug-location !20128 ; CHECK-NEXT: $w0 = nsw ADDWri [[COPY]], 1, 0, debug-location !21129 ; CHECK-NEXT: TCRETURNdi @f, 0, csr_aarch64_aapcs, implicit $sp, implicit $w0, debug-location !23130 DBG_VALUE $w0, $noreg, !16, !DIExpression(), debug-location !20131 %0:gpr32common = COPY $w0132 DBG_VALUE %0, $noreg, !16, !DIExpression(), debug-location !20133 %1:gpr32sp = nsw ADDWri %0, 1, 0, debug-location !21134 DBG_VALUE %1, $noreg, !17, !DIExpression(), debug-location !20135 DBG_VALUE %1, $noreg, !18, !DIExpression(), debug-location !20136 ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp, debug-location !22137 $w0 = COPY %1, debug-location !22138 BL @f, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit $w0, implicit-def $sp, implicit-def $w0, debug-location !22139 ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp, debug-location !22140 DBG_VALUE %1, $noreg, !19, !DIExpression(), debug-location !20141 $w0 = COPY %1, debug-location !23142 TCRETURNdi @f, 0, csr_aarch64_aapcs, implicit $sp, implicit $w0, debug-location !23143 144...145