brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.9 KiB · 2445306 Raw
119 lines · plain
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py2# RUN: llc -mcpu=corei7 -no-stack-coloring=false -run-pass=stack-coloring -o - %s | FileCheck %s3# RUN: llc -mcpu=corei7 -no-stack-coloring=false -passes=stack-coloring -o - %s | FileCheck %s4 5# Difference between test_1 and test_2 is that there is a DBG_VALUE in test_1.6# If transformation is debug invariant the resulting LEA instruction should be7# the same (i.e. we should reuse the same stack slot).8 9--- |10  ; ModuleID = '<stdin>'11  source_filename = "StackColoring-dbg-invariance.ll"12  target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"13  target triple = "x86_64-apple-macosx10.8.0"14 15  ; Function Attrs: argmemonly nofree nosync nounwind willreturn16  declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #017 18  ; Function Attrs: argmemonly nofree nosync nounwind willreturn19  declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #020 21  define i32 @test_1(i32 %in) #1 !dbg !5 {22  entry:23    %a1 = alloca [14 x ptr], align 824    %a4 = alloca [11 x ptr], align 825    call void @llvm.dbg.value(metadata ptr %a4, metadata !9, metadata !DIExpression()), !dbg !1126    ret i32 027  }28 29  define i32 @test_2(i32 %in) #1 !dbg !12 {30  entry:31    %a1 = alloca [14 x ptr], align 832    %a4 = alloca [11 x ptr], align 833    ret i32 034  }35 36  ; Function Attrs: nofree nosync nounwind readnone speculatable willreturn37  declare void @llvm.dbg.value(metadata, metadata, metadata) #238 39  attributes #0 = { argmemonly nofree nosync nounwind willreturn "target-cpu"="corei7" }40  attributes #1 = { "target-cpu"="corei7" }41 42  !llvm.dbg.cu = !{!0}43  !llvm.debugify = !{!2, !3}44  !llvm.module.flags = !{!4}45 46  !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug)47  !1 = !DIFile(filename: "StackColoring-dbg-invariance.ll", directory: "/")48  !2 = !{i32 27}49  !3 = !{i32 18}50  !4 = !{i32 2, !"Debug Info Version", i32 3}51  !5 = distinct !DISubprogram(name: "test_1", linkageName: "test_1", scope: null, file: !1, line: 1, type: !6, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !8)52  !6 = !DISubroutineType(types: !7)53  !7 = !{}54  !8 = !{!9}55  !9 = !DILocalVariable(name: "4", scope: !5, file: !1, line: 4, type: !10)56  !10 = !DIBasicType(name: "ty64", size: 64, encoding: DW_ATE_unsigned)57  !11 = !DILocation(line: 4, column: 1, scope: !5)58  !12 = distinct !DISubprogram(name: "test_2", linkageName: "test_2", scope: null, file: !1, line: 1, type: !6, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !7)59 60...61---62name:            test_163alignment:       1664tracksRegLiveness: true65stack:66  - { id: 0, name: a1, type: default, offset: 0, size: 112, alignment: 8,67      stack-id: default, callee-saved-register: '', callee-saved-restored: true,68      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }69  - { id: 3, name: a4, type: default, offset: 0, size: 88, alignment: 8,70      stack-id: default, callee-saved-register: '', callee-saved-restored: true,71      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }72body:             |73  bb.0.entry:74    liveins: $edi75 76    ; CHECK-LABEL: name: test_177    ; CHECK: liveins: $edi78    ; CHECK: DBG_VALUE %stack.0.a1, $noreg, !9, !DIExpression(), debug-location !1179    ; CHECK: [[LEA64r:%[0-9]+]]:gr64 = LEA64r %stack.0.a1, 1, $noreg, 0, $noreg80    ; CHECK: [[LEA64r1:%[0-9]+]]:gr64 = LEA64r %stack.0.a1, 1, $noreg, 0, $noreg81    ; CHECK: RET 082    DBG_VALUE %stack.3.a4, $noreg, !9, !DIExpression(), debug-location !1183    LIFETIME_START %stack.3.a484    LIFETIME_START %stack.0.a185    %0:gr64 = LEA64r %stack.0.a1, 1, $noreg, 0, $noreg86    LIFETIME_END %stack.0.a187    %1:gr64 = LEA64r %stack.3.a4, 1, $noreg, 0, $noreg88    LIFETIME_END %stack.3.a489    RET 090...91---92name:            test_293alignment:       1694tracksRegLiveness: true95stack:96  - { id: 0, name: a1, type: default, offset: 0, size: 112, alignment: 8,97      stack-id: default, callee-saved-register: '', callee-saved-restored: true,98      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }99  - { id: 3, name: a4, type: default, offset: 0, size: 88, alignment: 8,100      stack-id: default, callee-saved-register: '', callee-saved-restored: true,101      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }102body:             |103  bb.0.entry:104    liveins: $edi105 106    ; CHECK-LABEL: name: test_2107    ; CHECK: liveins: $edi108    ; CHECK: [[LEA64r:%[0-9]+]]:gr64 = LEA64r %stack.0.a1, 1, $noreg, 0, $noreg109    ; CHECK: [[LEA64r1:%[0-9]+]]:gr64 = LEA64r %stack.0.a1, 1, $noreg, 0, $noreg110    ; CHECK: RET 0111    LIFETIME_START %stack.3.a4112    LIFETIME_START %stack.0.a1113    %0:gr64 = LEA64r %stack.0.a1, 1, $noreg, 0, $noreg114    LIFETIME_END %stack.0.a1115    %1:gr64 = LEA64r %stack.3.a4, 1, $noreg, 0, $noreg116    LIFETIME_END %stack.3.a4117    RET 0118...119