brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · 0b3f01b Raw
35 lines · plain
1; RUN: opt -passes=loop-vectorize -force-vector-width=2 -pass-remarks-missed='loop-vectorize' -S < %s 2>&1 | FileCheck %s2 3; CHECK: remark: <unknown>:0:0: loop not vectorized: integer loop induction variable could not be identified4 5; Test-case ('-O2 -ffast-math') from PR38800.6; (Set '-force-vector-width=2' to enable vector code generation.)7;8; No integral induction variable in the source-code caused a compiler-crash9; when attempting to vectorize.  With the fix, a remark indicating why it10; wasn't vectorized is produced11;12;void foo(float *ptr, float val) {13;  float f;14;  for (f = 0.1f; f < 1.0f; f += 0.01f)15;    *ptr += val;16;}17 18define void @foo(ptr nocapture %ptr, float %val) local_unnamed_addr {19entry:20  %ptr.promoted = load float, ptr %ptr, align 421  br label %for.body22 23for.body:                                         ; preds = %entry, %for.body24  %add5 = phi float [ %ptr.promoted, %entry ], [ %add, %for.body ]25  %f.04 = phi float [ 0x3FB99999A0000000, %entry ], [ %add1, %for.body ]26  %add = fadd fast float %add5, %val27  %add1 = fadd fast float %f.04, 0x3F847AE14000000028  %cmp = fcmp fast olt float %add1, 1.000000e+0029  br i1 %cmp, label %for.body, label %for.end30 31for.end:                                          ; preds = %for.body32  store float %add, ptr %ptr, align 433  ret void34}35