brintos

brintos / llvm-project-archived public Read only

0
0
Text · 5.9 KiB · 215a73b Raw
117 lines · plain
1; RUN: llc %s -o - -stop-after=livedebugvalues -opt-bisect-limit=0 \2; RUN:   | FileCheck %s3; RUN: llc %s -o - -stop-after=livedebugvalues -opt-bisect-limit=10 \4; RUN:   | FileCheck %s5; RUN: llc %s -o - -stop-after=livedebugvalues -opt-bisect-limit=20 \6; RUN:   | FileCheck %s7; RUN: llc %s -o - -stop-after=livedebugvalues -opt-bisect-limit=30 \8; RUN:   | FileCheck %s9; RUN: llc %s -o - -stop-after=livedebugvalues -opt-bisect-limit=40 \10; RUN:   | FileCheck %s11; RUN: llc %s -o - -stop-after=livedebugvalues -opt-bisect-limit=100 \12; RUN:   | FileCheck %s13;; Test fast-isel for good measure too,14; RUN: llc %s -o - -stop-after=livedebugvalues -fast-isel=true \15; RUN:   | FileCheck %s16; RUN: llc %s -o - -stop-after=livedebugvalues -fast-isel=true \17; RUN:   -opt-bisect-limit=0 | FileCheck %s18; RUN: llc %s -o - -stop-after=livedebugvalues -fast-isel=true \19; RUN:   -opt-bisect-limit=10 | FileCheck %s20; RUN: llc %s -o - -stop-after=livedebugvalues -fast-isel=true \21; RUN:   -opt-bisect-limit=100 | FileCheck %s22 23; The function below should be optimised with the "default" optimisation level.24; However, opt-bisect-limit causes SelectionDAG to change the target settings25; for the duration of SelectionDAG. This can lead to variable locations created26; in one mode, but the rest of the debug-info analyses expecting the other.27; Test that opt-bisect-limit can be used without any assertions firing, and28; that instruction referencing instructions are seen each time.29;30; The selection of bisect positions above are not picked meaningfully, the31; pass order and positioning will change over time. The most important part32; is that the bisect limit sits between SelectionDAG and debug-info passes at33; some point.34 35; CHECK: DBG_INSTR_REF36; CHECK: DBG_PHI37 38; ModuleID = '/tmp/test.cpp'39source_filename = "/tmp/test.cpp"40target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"41target triple = "x86_64-unknown-linux-gnu"42 43%class.Class = type { i8 }44 45; Function Attrs: mustprogress uwtable46define dso_local void @_Z4FuncP5Class(ptr noundef %c) local_unnamed_addr !dbg !7 {47entry:48  call void @llvm.dbg.value(metadata ptr %c, metadata !15, metadata !DIExpression()), !dbg !1649  %tobool.not = icmp eq ptr %c, null, !dbg !1750  br i1 %tobool.not, label %land.lhs.true, label %if.end, !dbg !1951 52land.lhs.true:                                    ; preds = %entry53  %call = call noundef zeroext i1 @_Z4Condv(), !dbg !2054  call void @llvm.assume(i1 %call), !dbg !2155  %call1 = call noalias noundef nonnull dereferenceable(1) ptr @_Znwm(i64 noundef 1), !dbg !22, !heapallocsite !1256  call void @llvm.dbg.value(metadata ptr %call1, metadata !15, metadata !DIExpression()), !dbg !1657  br label %if.end, !dbg !2358 59if.end:                                           ; preds = %land.lhs.true, %entry60  %c.addr.0 = phi ptr [ %c, %entry ], [ %call1, %land.lhs.true ]61  call void @llvm.dbg.value(metadata ptr %c.addr.0, metadata !15, metadata !DIExpression()), !dbg !1662  call void @_Z11DoSomethingR5Class(ptr noundef nonnull align 1 dereferenceable(1) %c.addr.0), !dbg !2463  ret void, !dbg !2564}65 66declare !dbg !26 dso_local noundef zeroext i1 @_Z4Condv() local_unnamed_addr67 68; Function Attrs: nobuiltin allocsize(0)69declare dso_local noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr70 71declare !dbg !30 dso_local void @_Z11DoSomethingR5Class(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr72 73; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn74declare void @llvm.dbg.value(metadata, metadata, metadata)75 76; Function Attrs: inaccessiblememonly nocallback nofree nosync nounwind willreturn77declare void @llvm.assume(i1 noundef)78 79!llvm.dbg.cu = !{!0}80!llvm.module.flags = !{!2, !3, !4, !5}81!llvm.ident = !{!6}82 83!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None)84!1 = !DIFile(filename: "/tmp/test.cpp", directory: ".")85!2 = !{i32 7, !"Dwarf Version", i32 5}86!3 = !{i32 2, !"Debug Info Version", i32 3}87!4 = !{i32 1, !"wchar_size", i32 4}88!5 = !{i32 7, !"uwtable", i32 2}89!6 = !{!"clang"}90!7 = distinct !DISubprogram(name: "Func", linkageName: "_Z4FuncP5Class", scope: !8, file: !8, line: 6, type: !9, scopeLine: 6, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !14)91!8 = !DIFile(filename: "/tmp/test.cpp", directory: "")92!9 = !DISubroutineType(types: !10)93!10 = !{null, !11}94!11 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !12, size: 64)95!12 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "Class", file: !8, line: 3, size: 8, flags: DIFlagTypePassByValue, elements: !13, identifier: "_ZTS5Class")96!13 = !{}97!14 = !{!15}98!15 = !DILocalVariable(name: "c", arg: 1, scope: !7, file: !8, line: 6, type: !11)99!16 = !DILocation(line: 0, scope: !7)100!17 = !DILocation(line: 7, column: 10, scope: !18)101!18 = distinct !DILexicalBlock(scope: !7, file: !8, line: 7, column: 9)102!19 = !DILocation(line: 7, column: 12, scope: !18)103!20 = !DILocation(line: 7, column: 15, scope: !18)104!21 = !DILocation(line: 7, column: 9, scope: !7)105!22 = !DILocation(line: 8, column: 13, scope: !18)106!23 = !DILocation(line: 8, column: 9, scope: !18)107!24 = !DILocation(line: 10, column: 5, scope: !7)108!25 = !DILocation(line: 11, column: 1, scope: !7)109!26 = !DISubprogram(name: "Cond", linkageName: "_Z4Condv", scope: !8, file: !8, line: 5, type: !27, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !13)110!27 = !DISubroutineType(types: !28)111!28 = !{!29}112!29 = !DIBasicType(name: "bool", size: 8, encoding: DW_ATE_boolean)113!30 = !DISubprogram(name: "DoSomething", linkageName: "_Z11DoSomethingR5Class", scope: !8, file: !8, line: 4, type: !31, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !13)114!31 = !DISubroutineType(types: !32)115!32 = !{null, !33}116!33 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !12, size: 64)117