brintos

brintos / llvm-project-archived public Read only

0
0
Text · 5.1 KiB · a280c71 Raw
101 lines · plain
1; RUN: opt < %s -passes=loop-vectorize,transform-warning -S 2>&1 | FileCheck %s2 3; Verify warning is generated when vectorization/ interleaving is explicitly specified and fails to occur.4; CHECK: warning: no_array_bounds.cpp:5:5: loop not vectorized: the optimizer was unable to perform the requested transformation; the transformation might be disabled or specified as part of an unsupported transformation ordering5; CHECK: warning: no_array_bounds.cpp:10:5: loop not interleaved: the optimizer was unable to perform the requested transformation; the transformation might be disabled or specified as part of an unsupported transformation ordering6 7;  #pragma clang loop vectorize(enable)8;  for (int i = 0; i < number; i++) {9;    A[B[i]]++;10;  }11 12;  #pragma clang loop vectorize(disable) interleave(enable)13;  for (int i = 0; i < number; i++) {14;    B[A[i]]++;15;  }16 17target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"18 19; Function Attrs: nounwind ssp uwtable20define void @_Z4testPiS_i(ptr nocapture %A, ptr nocapture %B, i32 %number) #0 !dbg !4 {21entry:22  %cmp25 = icmp sgt i32 %number, 0, !dbg !1023  br i1 %cmp25, label %for.body.preheader, label %for.end15, !dbg !10, !llvm.loop !1224 25for.body.preheader:                               ; preds = %entry26  br label %for.body, !dbg !1427 28for.cond5.preheader:                              ; preds = %for.body29  br i1 %cmp25, label %for.body7.preheader, label %for.end15, !dbg !16, !llvm.loop !1830 31for.body7.preheader:                              ; preds = %for.cond5.preheader32  br label %for.body7, !dbg !2033 34for.body:                                         ; preds = %for.body.preheader, %for.body35  %indvars.iv27 = phi i64 [ %indvars.iv.next28, %for.body ], [ 0, %for.body.preheader ]36  %arrayidx = getelementptr inbounds i32, ptr %B, i64 %indvars.iv27, !dbg !1437  %0 = load i32, ptr %arrayidx, align 4, !dbg !14, !tbaa !2238  %idxprom1 = sext i32 %0 to i64, !dbg !1439  %arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %idxprom1, !dbg !1440  %1 = load i32, ptr %arrayidx2, align 4, !dbg !14, !tbaa !2241  %inc = add nsw i32 %1, 1, !dbg !1442  store i32 %inc, ptr %arrayidx2, align 4, !dbg !14, !tbaa !2243  %indvars.iv.next28 = add nuw nsw i64 %indvars.iv27, 1, !dbg !1044  %lftr.wideiv29 = trunc i64 %indvars.iv.next28 to i32, !dbg !1045  %exitcond30 = icmp eq i32 %lftr.wideiv29, %number, !dbg !1046  br i1 %exitcond30, label %for.cond5.preheader, label %for.body, !dbg !10, !llvm.loop !1247 48for.body7:                                        ; preds = %for.body7.preheader, %for.body749  %indvars.iv = phi i64 [ %indvars.iv.next, %for.body7 ], [ 0, %for.body7.preheader ]50  %arrayidx9 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv, !dbg !2051  %2 = load i32, ptr %arrayidx9, align 4, !dbg !20, !tbaa !2252  %idxprom10 = sext i32 %2 to i64, !dbg !2053  %arrayidx11 = getelementptr inbounds i32, ptr %B, i64 %idxprom10, !dbg !2054  %3 = load i32, ptr %arrayidx11, align 4, !dbg !20, !tbaa !2255  %inc12 = add nsw i32 %3, 1, !dbg !2056  store i32 %inc12, ptr %arrayidx11, align 4, !dbg !20, !tbaa !2257  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1, !dbg !1658  %lftr.wideiv = trunc i64 %indvars.iv.next to i32, !dbg !1659  %exitcond = icmp eq i32 %lftr.wideiv, %number, !dbg !1660  br i1 %exitcond, label %for.end15.loopexit, label %for.body7, !dbg !16, !llvm.loop !1861 62for.end15.loopexit:                               ; preds = %for.body763  br label %for.end1564 65for.end15:                                        ; preds = %for.end15.loopexit, %entry, %for.cond5.preheader66  ret void, !dbg !2667}68 69attributes #0 = { nounwind }70 71!llvm.dbg.cu = !{!0}72!llvm.module.flags = !{!7, !8}73!llvm.ident = !{!9}74 75!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0", isOptimized: true, emissionKind: LineTablesOnly, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)76!1 = !DIFile(filename: "no_array_bounds.cpp", directory: ".")77!2 = !{}78!4 = distinct !DISubprogram(name: "test", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 2, file: !1, scope: !5, type: !6, retainedNodes: !2)79!5 = !DIFile(filename: "no_array_bounds.cpp", directory: ".")80!6 = !DISubroutineType(types: !2)81!7 = !{i32 2, !"Dwarf Version", i32 2}82!8 = !{i32 2, !"Debug Info Version", i32 3}83!9 = !{!"clang version 3.5.0"}84!10 = !DILocation(line: 4, column: 8, scope: !11)85!11 = distinct !DILexicalBlock(line: 4, column: 3, file: !1, scope: !4)86!12 = !{!12, !13}87!13 = !{!"llvm.loop.vectorize.enable", i1 true}88!14 = !DILocation(line: 5, column: 5, scope: !15)89!15 = distinct !DILexicalBlock(line: 4, column: 36, file: !1, scope: !11)90!16 = !DILocation(line: 9, column: 8, scope: !17)91!17 = distinct !DILexicalBlock(line: 9, column: 3, file: !1, scope: !4)92!18 = !{!18, !13, !19}93!19 = !{!"llvm.loop.vectorize.width", i32 1}94!20 = !DILocation(line: 10, column: 5, scope: !21)95!21 = distinct !DILexicalBlock(line: 9, column: 36, file: !1, scope: !17)96!22 = !{!23, !23, i64 0}97!23 = !{!"int", !24, i64 0}98!24 = !{!"omnipotent char", !25, i64 0}99!25 = !{!"Simple C/C++ TBAA"}100!26 = !DILocation(line: 12, column: 1, scope: !4)101