68 lines · plain
1; RUN: opt %loadNPMPolly -pass-remarks-missed=polly-detect -polly-detect-track-failures '-passes=polly-custom<detect>' -polly-print-detect -disable-output < %s 2>&1 | FileCheck %s2 3; void f(int A[]) {4; for(int i=0; i<42; ++i)5; A[i*i] = 0;6; }7 8; CHECK: remark: ReportNonAffineAccess-01.c:2:7: The following errors keep this region from being a Scop.9; CHECK: remark: ReportNonAffineAccess-01.c:3:5: The array subscript of "A" is not affine10; CHECK: remark: ReportNonAffineAccess-01.c:3:5: Invalid Scop candidate ends here.11 12target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"13 14define void @f(ptr %A) !dbg !4 {15entry:16 br label %entry.split17 18entry.split: ; preds = %entry19 tail call void @llvm.dbg.value(metadata ptr %A, i64 0, metadata !13, metadata !DIExpression()), !dbg !1420 tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !16, metadata !DIExpression()), !dbg !1821 br label %for.body, !dbg !1922 23for.body: ; preds = %entry.split, %for.body24 %0 = phi i32 [ 0, %entry.split ], [ %1, %for.body ], !dbg !2025 %mul = mul nsw i32 %0, %0, !dbg !2026 %idxprom1 = zext i32 %mul to i64, !dbg !2027 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %idxprom1, !dbg !2028 store i32 0, ptr %arrayidx, align 4, !dbg !2029 %1 = add nsw i32 %0, 1, !dbg !2130 tail call void @llvm.dbg.value(metadata i32 %1, i64 0, metadata !16, metadata !DIExpression()), !dbg !1831 %exitcond = icmp ne i32 %1, 42, !dbg !1932 br i1 %exitcond, label %for.body, label %for.end, !dbg !1933 34for.end: ; preds = %for.body35 ret void, !dbg !2236}37 38declare void @llvm.dbg.declare(metadata, metadata, metadata)39 40declare void @llvm.dbg.value(metadata, i64, metadata, metadata)41 42!llvm.dbg.cu = !{!0}43!llvm.module.flags = !{!10, !11}44!llvm.ident = !{!12}45 46!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.6.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)47!1 = !DIFile(filename: "ReportNonAffineAccess-01.c", directory: "test/ScopDetectionDiagnostic/")48!2 = !{}49!4 = distinct !DISubprogram(name: "f", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 1, file: !1, scope: !5, type: !6, retainedNodes: !2)50!5 = !DIFile(filename: "ReportNonAffineAccess-01.c", directory: "test/ScopDetectionDiagnostic/")51!6 = !DISubroutineType(types: !7)52!7 = !{null, !8}53!8 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !9)54!9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)55!10 = !{i32 2, !"Dwarf Version", i32 4}56!11 = !{i32 2, !"Debug Info Version", i32 3}57!12 = !{!"clang version 3.6.0 "}58!13 = !DILocalVariable(name: "A", line: 1, arg: 1, scope: !4, file: !5, type: !8)59!14 = !DILocation(line: 1, column: 12, scope: !4)60!15 = !{i32 0}61!16 = !DILocalVariable(name: "i", line: 2, scope: !17, file: !5, type: !9)62!17 = distinct !DILexicalBlock(line: 2, column: 3, file: !1, scope: !4)63!18 = !DILocation(line: 2, column: 11, scope: !17)64!19 = !DILocation(line: 2, column: 7, scope: !17)65!20 = !DILocation(line: 3, column: 5, scope: !17)66!21 = !DILocation(line: 2, column: 22, scope: !17)67!22 = !DILocation(line: 4, column: 1, scope: !4)68