brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.4 KiB · c864c32 Raw
89 lines · plain
1; RUN: opt -S -passes=loop-rotate -verify-memoryssa < %s | FileCheck %s2source_filename = "/tmp/loop.c"3target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"4target triple = "x86_64-apple-macosx10.13.0"5 6; Function Attrs: nounwind ssp uwtable7define void @f(ptr %input, i64 %n, i64 %s) local_unnamed_addr #0 !dbg !8 {8entry:9  call void @llvm.dbg.value(metadata ptr %input, metadata !15, metadata !DIExpression()), !dbg !2010  call void @llvm.dbg.value(metadata i64 %n, metadata !16, metadata !DIExpression()), !dbg !2111  call void @llvm.dbg.value(metadata i64 %s, metadata !17, metadata !DIExpression()), !dbg !2212  call void @llvm.dbg.value(metadata i64 0, metadata !18, metadata !DIExpression()), !dbg !2313  ; CHECK:   #dbg_value(i64 0, !18, !DIExpression(), !2314  ; CHECK-NOT:   #dbg_value(i64 0, !18, !DIExpression(), !2315  br label %for.cond, !dbg !2416 17for.cond:                                         ; preds = %for.body, %entry18  ; CHECK: %i.02 = phi i64 [ 0, %for.body.lr.ph ], [ %add, %for.body ]19  %i.0 = phi i64 [ 0, %entry ], [ %add, %for.body ]20  call void @llvm.dbg.value(metadata i64 %i.0, metadata !18, metadata !DIExpression()), !dbg !2321  %cmp = icmp slt i64 %i.0, %n, !dbg !2522  br i1 %cmp, label %for.body, label %for.cond.cleanup, !dbg !2723 24for.cond.cleanup:                                 ; preds = %for.cond25  ret void, !dbg !2826 27for.body:                                         ; preds = %for.cond28  %arrayidx = getelementptr inbounds float, ptr %input, i64 %i.0, !dbg !2929  %0 = load float, ptr %arrayidx, align 4, !dbg !29, !tbaa !3030  call void @bar(float %0), !dbg !3431  %add = add nsw i64 %i.0, %s, !dbg !3532  call void @llvm.dbg.value(metadata i64 %add, metadata !18, metadata !DIExpression()), !dbg !2333  ; CHECK:   #dbg_value(i64 %add, !18, !DIExpression(), !2334  ; CHECK-NOT:   #dbg_value(i64 %add, !18, !DIExpression(), !2335  br label %for.cond, !dbg !36, !llvm.loop !3736}37 38declare void @bar(float) local_unnamed_addr #139 40; Function Attrs: nounwind readnone speculatable41declare void @llvm.dbg.value(metadata, metadata, metadata) #242 43attributes #0 = { nounwind ssp uwtable }44attributes #2 = { nounwind readnone speculatable }45 46!llvm.dbg.cu = !{!0}47!llvm.module.flags = !{!3, !4, !5, !6}48!llvm.ident = !{!7}49 50!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 6.0.0 (trunk 316689) (llvm/trunk 316685)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)51!1 = !DIFile(filename: "/tmp/loop.c", directory: "/Data/llvm")52!2 = !{}53!3 = !{i32 2, !"Dwarf Version", i32 4}54!4 = !{i32 2, !"Debug Info Version", i32 3}55!5 = !{i32 1, !"wchar_size", i32 4}56!6 = !{i32 7, !"PIC Level", i32 2}57!7 = !{!"clang version 6.0.0 (trunk 316689) (llvm/trunk 316685)"}58!8 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 2, type: !9, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, unit: !0, retainedNodes: !14)59!9 = !DISubroutineType(types: !10)60!10 = !{null, !11, !13, !13}61!11 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !12, size: 64)62!12 = !DIBasicType(name: "float", size: 32, encoding: DW_ATE_float)63!13 = !DIBasicType(name: "long long int", size: 64, encoding: DW_ATE_signed)64!14 = !{!15, !16, !17, !18}65!15 = !DILocalVariable(name: "input", arg: 1, scope: !8, file: !1, line: 2, type: !11)66!16 = !DILocalVariable(name: "n", arg: 2, scope: !8, file: !1, line: 2, type: !13)67!17 = !DILocalVariable(name: "s", arg: 3, scope: !8, file: !1, line: 2, type: !13)68!18 = !DILocalVariable(name: "i", scope: !19, file: !1, line: 3, type: !13)69!19 = distinct !DILexicalBlock(scope: !8, file: !1, line: 3, column: 3)70!20 = !DILocation(line: 2, column: 15, scope: !8)71!21 = !DILocation(line: 2, column: 32, scope: !8)72!22 = !DILocation(line: 2, column: 45, scope: !8)73!23 = !DILocation(line: 3, column: 18, scope: !19)74!24 = !DILocation(line: 3, column: 8, scope: !19)75!25 = !DILocation(line: 3, column: 26, scope: !26)76!26 = distinct !DILexicalBlock(scope: !19, file: !1, line: 3, column: 3)77!27 = !DILocation(line: 3, column: 3, scope: !19)78!28 = !DILocation(line: 5, column: 1, scope: !8)79!29 = !DILocation(line: 4, column: 9, scope: !26)80!30 = !{!31, !31, i64 0}81!31 = !{!"float", !32, i64 0}82!32 = !{!"omnipotent char", !33, i64 0}83!33 = !{!"Simple C/C++ TBAA"}84!34 = !DILocation(line: 4, column: 5, scope: !26)85!35 = !DILocation(line: 3, column: 31, scope: !26)86!36 = !DILocation(line: 3, column: 3, scope: !26)87!37 = distinct !{!37, !27, !38}88!38 = !DILocation(line: 4, column: 17, scope: !19)89