108 lines · plain
1; RUN: opt < %s -passes=loop-vectorize -mtriple=x86_64-unknown-linux -S -pass-remarks='loop-vectorize' -pass-remarks-missed='loop-vectorize' -pass-remarks-analysis='loop-vectorize' 2>&1 | FileCheck %s2 3; CHECK: remark: no_fpmath.c:6:11: loop not vectorized: cannot prove it is safe to reorder floating-point operations4; CHECK: remark: no_fpmath.c:6:14: loop not vectorized5; CHECK: remark: no_fpmath.c:17:14: vectorized loop (vectorization width: 2, interleaved count: 2)6 7target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"8target triple = "x86_64-apple-macosx10.10.0"9 10; Function Attrs: nounwind readonly ssp uwtable11define double @cond_sum(ptr nocapture readonly %v, i32 %n) #0 !dbg !4 {12entry:13 %cmp.7 = icmp sgt i32 %n, 0, !dbg !314 br i1 %cmp.7, label %for.body.preheader, label %for.cond.cleanup, !dbg !815 16for.body.preheader: ; preds = %entry17 br label %for.body, !dbg !918 19for.cond.cleanup.loopexit: ; preds = %for.body20 %add.lcssa = phi double [ %add, %for.body ]21 br label %for.cond.cleanup, !dbg !1022 23for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry24 %a.0.lcssa = phi double [ 0.000000e+00, %entry ], [ %add.lcssa, %for.cond.cleanup.loopexit ]25 ret double %a.0.lcssa, !dbg !1026 27for.body: ; preds = %for.body.preheader, %for.body28 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.body.preheader ]29 %a.08 = phi double [ %add, %for.body ], [ 0.000000e+00, %for.body.preheader ]30 %arrayidx = getelementptr inbounds i32, ptr %v, i64 %indvars.iv, !dbg !931 %0 = load i32, ptr %arrayidx, align 4, !dbg !9, !tbaa !1132 %cmp1 = icmp eq i32 %0, 0, !dbg !1533 %cond = select i1 %cmp1, double 3.400000e+00, double 1.150000e+00, !dbg !934 %add = fadd double %a.08, %cond, !dbg !1635 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1, !dbg !836 %lftr.wideiv = trunc i64 %indvars.iv.next to i32, !dbg !837 %exitcond = icmp eq i32 %lftr.wideiv, %n, !dbg !838 br i1 %exitcond, label %for.cond.cleanup.loopexit, label %for.body, !dbg !839}40 41; Function Attrs: nounwind readonly ssp uwtable42define double @cond_sum_loop_hint(ptr nocapture readonly %v, i32 %n) #0 !dbg !20 {43entry:44 %cmp.7 = icmp sgt i32 %n, 0, !dbg !1945 br i1 %cmp.7, label %for.body.preheader, label %for.cond.cleanup, !dbg !2146 47for.body.preheader: ; preds = %entry48 br label %for.body, !dbg !2249 50for.cond.cleanup.loopexit: ; preds = %for.body51 %add.lcssa = phi double [ %add, %for.body ]52 br label %for.cond.cleanup, !dbg !2353 54for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry55 %a.0.lcssa = phi double [ 0.000000e+00, %entry ], [ %add.lcssa, %for.cond.cleanup.loopexit ]56 ret double %a.0.lcssa, !dbg !2357 58for.body: ; preds = %for.body.preheader, %for.body59 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.body.preheader ]60 %a.08 = phi double [ %add, %for.body ], [ 0.000000e+00, %for.body.preheader ]61 %arrayidx = getelementptr inbounds i32, ptr %v, i64 %indvars.iv, !dbg !2262 %0 = load i32, ptr %arrayidx, align 4, !dbg !22, !tbaa !1163 %cmp1 = icmp eq i32 %0, 0, !dbg !2464 %cond = select i1 %cmp1, double 3.400000e+00, double 1.150000e+00, !dbg !2265 %add = fadd double %a.08, %cond, !dbg !2566 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1, !dbg !2167 %lftr.wideiv = trunc i64 %indvars.iv.next to i32, !dbg !2168 %exitcond = icmp eq i32 %lftr.wideiv, %n, !dbg !2169 br i1 %exitcond, label %for.cond.cleanup.loopexit, label %for.body, !dbg !21, !llvm.loop !2670}71 72attributes #0 = { nounwind }73 74!llvm.dbg.cu = !{!28}75!llvm.module.flags = !{!0, !1}76!llvm.ident = !{!2}77 78!0 = !{i32 2, !"Debug Info Version", i32 3}79!1 = !{i32 1, !"PIC Level", i32 2}80!2 = !{!"clang version 3.7.0"}81!3 = !DILocation(line: 5, column: 20, scope: !4)82!4 = distinct !DISubprogram(name: "cond_sum", scope: !5, file: !5, line: 1, type: !6, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, unit: !28, retainedNodes: !7)83!5 = !DIFile(filename: "no_fpmath.c", directory: "")84!6 = !DISubroutineType(types: !7)85!7 = !{}86!8 = !DILocation(line: 5, column: 3, scope: !4)87!9 = !DILocation(line: 6, column: 14, scope: !4)88!10 = !DILocation(line: 9, column: 3, scope: !4)89!11 = !{!12, !12, i64 0}90!12 = !{!"int", !13, i64 0}91!13 = !{!"omnipotent char", !14, i64 0}92!14 = !{!"Simple C/C++ TBAA"}93!15 = !DILocation(line: 6, column: 19, scope: !4)94!16 = !DILocation(line: 6, column: 11, scope: !4)95!19 = !DILocation(line: 16, column: 20, scope: !20)96!20 = distinct !DISubprogram(name: "cond_sum_loop_hint", scope: !5, file: !5, line: 12, type: !6, isLocal: false, isDefinition: true, scopeLine: 12, flags: DIFlagPrototyped, isOptimized: true, unit: !28, retainedNodes: !7)97!21 = !DILocation(line: 16, column: 3, scope: !20)98!22 = !DILocation(line: 17, column: 14, scope: !20)99!23 = !DILocation(line: 20, column: 3, scope: !20)100!24 = !DILocation(line: 17, column: 19, scope: !20)101!25 = !DILocation(line: 17, column: 11, scope: !20)102!26 = distinct !{!26, !27}103!27 = !{!"llvm.loop.vectorize.enable", i1 true}104!28 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang",105 file: !5,106 isOptimized: true, flags: "-O2",107 splitDebugFilename: "abc.debug", emissionKind: 2)108