brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.3 KiB · 69aab00 Raw
103 lines · plain
1# RUN: llc -mtriple=hexagon -run-pass hwloops -o - %s | FileCheck %s2 3# This used to crash with `Assertion `isReg() && "This is not a register operand!"`4# CHECK: J2_loop0r5 6--- |7  target datalayout = "e-m:e-p:32:32:32-a:0-n16:32-i64:64:64-i32:32:32-i16:16:16-i1:8:8-f32:32:32-f64:64:64-v32:32:32-v64:64:64-v512:512:512-v1024:1024:1024-v2048:2048:2048"8  target triple = "hexagon"9 10  %s.0 = type { i32 }11 12  @g0 = external dso_local local_unnamed_addr global ptr, align 4, !dbg !013 14  define dso_local void @f0() local_unnamed_addr #0 !dbg !13 {15  b0:16    %v0 = sext i16 undef to i3217    br i1 undef, label %b2, label %b118 19  b1:                                               ; preds = %b1, %b020    %v1 = phi i32 [ %v2, %b1 ], [ undef, %b0 ]21    %v2 = add nsw i32 %v1, -822    %v3 = add nsw i32 %v2, %v023    call void @llvm.dbg.value(metadata i32 %v3, metadata !19, metadata !DIExpression()), !dbg !2424    %v4 = load ptr, ptr @g0, align 425    %v5 = getelementptr inbounds %s.0, ptr %v4, i32 %v3, i32 026    store i32 undef, ptr %v5, align 427    %v6 = icmp eq i32 %v2, 028    br i1 %v6, label %b2, label %b129 30  b2:                                               ; preds = %b1, %b031    ret void32  }33 34  declare void @llvm.dbg.value(metadata, metadata, metadata) #135 36  attributes #0 = { "target-features"="+v66,-long-calls" }37  attributes #1 = { nofree nosync nounwind readnone speculatable willreturn }38 39  !llvm.dbg.cu = !{!2}40  !llvm.module.flags = !{!11, !12}41 42  !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())43  !1 = distinct !DIGlobalVariable(name: "g0", scope: !2, file: !3, line: 3, type: !6, isLocal: false, isDefinition: true)44  !2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 13.0.0 (https://github.com/llvm/llvm-project 93664503be6b3f47269cf617f8c46b6ce95f8076)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5, splitDebugInlining: false, nameTableKind: None)45  !3 = !DIFile(filename: "dev.i", directory: "/test")46  !4 = !{}47  !5 = !{!0}48  !6 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !7, size: 32)49  !7 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "s.0", file: !3, line: 1, size: 32, elements: !8)50  !8 = !{!9}51  !9 = !DIDerivedType(tag: DW_TAG_member, name: "m", scope: !7, file: !3, line: 2, baseType: !10, size: 32)52  !10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)53  !11 = !{i32 2, !"Debug Info Version", i32 3}54  !12 = !{i32 7, !"frame-pointer", i32 2}55  !13 = distinct !DISubprogram(name: "f0", scope: !3, file: !3, line: 9, type: !14, scopeLine: 9, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2, retainedNodes: !17)56  !14 = !DISubroutineType(types: !15)57  !15 = !{!10, !16}58  !16 = !DIBasicType(name: "unsigned short", size: 16, encoding: DW_ATE_unsigned)59  !17 = !{!18}60  !18 = !DILocalVariable(name: "x", arg: 1, scope: !13, file: !3, line: 9, type: !16)61  !19 = !DILocalVariable(name: "y", arg: 1, scope: !20, file: !3, line: 6, type: !10)62  !20 = distinct !DISubprogram(name: "f1", scope: !3, file: !3, line: 6, type: !21, scopeLine: 6, flags: DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2, retainedNodes: !23)63  !21 = !DISubroutineType(types: !22)64  !22 = !{!6, !10}65  !23 = !{!19}66  !24 = !DILocation(line: 0, scope: !20, inlinedAt: !25)67  !25 = distinct !DILocation(line: 11, column: 5, scope: !13)68 69...70 71---72name:              f073tracksRegLiveness: true74body: |75  bb.0.b0:76    successors: %bb.2(0x40000000), %bb.3(0x40000000); %bb.2(50.00%), %bb.3(50.00%)77 78    %6:predregs = IMPLICIT_DEF79    J2_jumpt %6:predregs, %bb.2, implicit-def $pc80 81  bb.3:82    successors: %bb.1(0x80000000); %bb.1(100.00%)83 84    %5:intregs = IMPLICIT_DEF85    %4:intregs = A2_tfrsi 086 87  bb.1.b1:88    successors: %bb.2(0x04000000), %bb.1(0x7c000000); %bb.2(3.12%), %bb.1(96.88%)89 90    %0:intregs = PHI %4:intregs, %bb.3, %3:intregs, %bb.191    %1:intregs = PHI %5:intregs, %bb.3, %2:intregs, %bb.192    %2:intregs = nsw A2_addi %1:intregs, -893    DBG_VALUE_LIST !19, !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_arg, 1, DW_OP_plus, DW_OP_stack_value), %2:intregs, 0, debug-location !2494    %3:intregs = A2_addi %0:intregs, -3295    %7:predregs = C2_cmpeqi %2:intregs, 096    J2_jumpf %7:predregs, %bb.1, implicit-def dead $pc97    J2_jump %bb.2, implicit-def dead $pc98 99  bb.2.b2:100    PS_jmpret $r31, implicit-def dead $pc101...102 103