1; Legacy pass manager 2; RUN: opt < %s -transform-warning -disable-output -pass-remarks-missed=transform-warning -pass-remarks-analysis=transform-warning 2>&1 | FileCheck %s 3; RUN: opt < %s -transform-warning -disable-output -pass-remarks-output=%t.yaml 4; RUN: cat %t.yaml | FileCheck -check-prefix=YAML %s 5 6; New pass manager 7; RUN: opt < %s -passes=transform-warning -disable-output -pass-remarks-missed=transform-warning -pass-remarks-analysis=transform-warning 2>&1 | FileCheck %s 8; RUN: opt < %s -passes=transform-warning -disable-output -pass-remarks-output=%t.yaml 9; RUN: cat %t.yaml | FileCheck -check-prefix=YAML %s 10 11 12; CHECK: warning: source.cpp:19:5: loop not unroll-and-jammed: the optimizer was unable to perform the requested transformation; the transformation might be disabled or specified as part of an unsupported transformation ordering 13 14; YAML: --- !Failure 15; YAML-NEXT: Pass: transform-warning 16; YAML-NEXT: Name: FailedRequestedUnrollAndJamming 17; YAML-NEXT: DebugLoc: { File: source.cpp, Line: 19, Column: 5 } 18; YAML-NEXT: Function: _Z17test_array_boundsPiS_i 19; YAML-NEXT: Args: 20; YAML-NEXT: - String: 'loop not unroll-and-jammed: the optimizer was unable to perform the requested transformation; the transformation might be disabled or specified as part of an unsupported transformation ordering' 21; YAML-NEXT: ... 22 23target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" 24 25define void @_Z17test_array_boundsPiS_i(i32* nocapture %A, i32* nocapture readonly %B, i32 %Length) !dbg !8 { 26entry: 27 %cmp9 = icmp sgt i32 %Length, 0, !dbg !32 28 br i1 %cmp9, label %for.body.preheader, label %for.end, !dbg !32 29 30for.body.preheader: 31 br label %for.body, !dbg !35 32 33for.body: 34 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.body.preheader ] 35 %arrayidx = getelementptr inbounds i32, i32* %B, i64 %indvars.iv, !dbg !35 36 %0 = load i32, i32* %arrayidx, align 4, !dbg !35, !tbaa !18 37 %idxprom1 = sext i32 %0 to i64, !dbg !35 38 %arrayidx2 = getelementptr inbounds i32, i32* %A, i64 %idxprom1, !dbg !35 39 %1 = load i32, i32* %arrayidx2, align 4, !dbg !35, !tbaa !18 40 %arrayidx4 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv, !dbg !35 41 store i32 %1, i32* %arrayidx4, align 4, !dbg !35, !tbaa !18 42 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1, !dbg !32 43 %lftr.wideiv = trunc i64 %indvars.iv.next to i32, !dbg !32 44 %exitcond = icmp eq i32 %lftr.wideiv, %Length, !dbg !32 45 br i1 %exitcond, label %for.end.loopexit, label %for.body, !dbg !32, !llvm.loop !50 46 47for.end.loopexit: 48 br label %for.end 49 50for.end: 51 ret void, !dbg !36 52} 53 54!llvm.dbg.cu = !{!0} 55!llvm.module.flags = !{!9, !10} 56!llvm.ident = !{!11} 57 58!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0", isOptimized: true, runtimeVersion: 6, emissionKind: LineTablesOnly, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2) 59!1 = !DIFile(filename: "source.cpp", directory: ".") 60!2 = !{} 61!4 = distinct !DISubprogram(name: "test", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 1, file: !1, scope: !5, type: !6, retainedNodes: !2) 62!5 = !DIFile(filename: "source.cpp", directory: ".") 63!6 = !DISubroutineType(types: !2) 64!7 = distinct !DISubprogram(name: "test_disabled", line: 10, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 10, file: !1, scope: !5, type: !6, retainedNodes: !2) 65!8 = distinct !DISubprogram(name: "test_array_bounds", line: 16, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 16, file: !1, scope: !5, type: !6, retainedNodes: !2) 66!9 = !{i32 2, !"Dwarf Version", i32 2} 67!10 = !{i32 2, !"Debug Info Version", i32 3} 68!11 = !{!"clang version 3.5.0"} 69!12 = !DILocation(line: 3, column: 8, scope: !13) 70!13 = distinct !DILexicalBlock(line: 3, column: 3, file: !1, scope: !4) 71!16 = !DILocation(line: 4, column: 5, scope: !17) 72!17 = distinct !DILexicalBlock(line: 3, column: 36, file: !1, scope: !13) 73!18 = !{!19, !19, i64 0} 74!19 = !{!"int", !20, i64 0} 75!20 = !{!"omnipotent char", !21, i64 0} 76!21 = !{!"Simple C/C++ TBAA"} 77!22 = !DILocation(line: 5, column: 9, scope: !23) 78!23 = distinct !DILexicalBlock(line: 5, column: 9, file: !1, scope: !17) 79!24 = !DILocation(line: 8, column: 1, scope: !4) 80!25 = !DILocation(line: 12, column: 8, scope: !26) 81!26 = distinct !DILexicalBlock(line: 12, column: 3, file: !1, scope: !7) 82!30 = !DILocation(line: 13, column: 5, scope: !26) 83!31 = !DILocation(line: 14, column: 1, scope: !7) 84!32 = !DILocation(line: 18, column: 8, scope: !33) 85!33 = distinct !DILexicalBlock(line: 18, column: 3, file: !1, scope: !8) 86!35 = !DILocation(line: 19, column: 5, scope: !33) 87!36 = !DILocation(line: 20, column: 1, scope: !8) 88!37 = distinct !DILexicalBlock(line: 24, column: 3, file: !1, scope: !46) 89!38 = !DILocation(line: 27, column: 3, scope: !37) 90!39 = !DILocation(line: 31, column: 3, scope: !37) 91!40 = !DILocation(line: 28, column: 9, scope: !37) 92!41 = !DILocation(line: 29, column: 11, scope: !37) 93!42 = !DILocation(line: 29, column: 7, scope: !37) 94!43 = !DILocation(line: 27, column: 32, scope: !37) 95!44 = !DILocation(line: 27, column: 30, scope: !37) 96!45 = !DILocation(line: 27, column: 21, scope: !37) 97!46 = distinct !DISubprogram(name: "test_multiple_failures", line: 26, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 26, file: !1, scope: !5, type: !6, retainedNodes: !2) 98 99!50 = !{!50, !{!"llvm.loop.unroll_and_jam.enable"}} 100