1 ; RUN: llc < %s -march=hexagon -disable-lsr | FileCheck %s
4 ; CHECK-NOT: add({{r[0-9]*}}, #
7 target datalayout = "e-p:32:32:32-i64:64:64-i32:32:32-i16:16:16-i1:32:32-f64:64:64-f32:32:32-v64:64:64-v32:32:32-a0:0-n16:32"
8 target triple = "hexagon"
10 define void @f0(ptr nocapture %a0, ptr nocapture %a1) #0 !dbg !4 {
12 call void @llvm.dbg.value(metadata ptr %a0, metadata !10, metadata !DIExpression()), !dbg !14
13 call void @llvm.dbg.value(metadata ptr %a1, metadata !11, metadata !DIExpression()), !dbg !15
14 call void @llvm.dbg.value(metadata i32 0, metadata !12, metadata !DIExpression()), !dbg !16
15 br label %b1, !dbg !16
17 b1: ; preds = %b1, %b0
18 %v0 = phi ptr [ %a0, %b0 ], [ %v7, %b1 ]
19 %v1 = phi i32 [ 0, %b0 ], [ %v5, %b1 ]
20 %v2 = phi ptr [ %a1, %b0 ], [ %v3, %b1 ]
21 %v3 = getelementptr inbounds i32, ptr %v2, i32 1, !dbg !18
22 call void @llvm.dbg.value(metadata ptr %v3, metadata !11, metadata !DIExpression()), !dbg !18
23 %v4 = load i32, ptr %v2, align 4, !dbg !18
24 store i32 %v4, ptr %v0, align 4, !dbg !18
25 %v5 = add nsw i32 %v1, 1, !dbg !20
26 call void @llvm.dbg.value(metadata i32 %v5, metadata !12, metadata !DIExpression()), !dbg !20
27 %v6 = icmp eq i32 %v5, 10, !dbg !16
28 %v7 = getelementptr i32, ptr %v0, i32 1
29 br i1 %v6, label %b2, label %b1, !dbg !16
35 declare void @llvm.dbg.value(metadata, metadata, metadata) #1
37 attributes #0 = { nounwind "target-cpu"="hexagonv5" }
38 attributes #1 = { nounwind readnone speculatable }
41 !llvm.module.flags = !{!3}
43 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "QuIC LLVM Hexagon Clang", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !2, globals: !2)
44 !1 = !DIFile(filename: "hwloop-dbg.c", directory: "/test")
46 !3 = !{i32 1, !"Debug Info Version", i32 3}
47 !4 = distinct !DISubprogram(name: "foo", scope: null, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 1, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, retainedNodes: !9)
48 !5 = !DISubroutineType(types: !6)
50 !7 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !8, size: 32, align: 32)
51 !8 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
53 !10 = !DILocalVariable(name: "a", arg: 1, scope: !4, file: !1, line: 1, type: !7)
54 !11 = !DILocalVariable(name: "b", arg: 2, scope: !4, file: !1, line: 1, type: !7)
55 !12 = !DILocalVariable(name: "i", scope: !13, file: !1, line: 2, type: !8)
56 !13 = distinct !DILexicalBlock(scope: !4, file: !1, line: 1, column: 26)
57 !14 = !DILocation(line: 1, column: 15, scope: !4)
58 !15 = !DILocation(line: 1, column: 23, scope: !4)
59 !16 = !DILocation(line: 3, column: 8, scope: !17)
60 !17 = distinct !DILexicalBlock(scope: !13, file: !1, line: 3, column: 3)
61 !18 = !DILocation(line: 4, column: 5, scope: !19)
62 !19 = distinct !DILexicalBlock(scope: !17, file: !1, line: 3, column: 28)
63 !20 = !DILocation(line: 3, column: 23, scope: !17)
64 !21 = !DILocation(line: 6, column: 1, scope: !13)