|
| 1 | +; RUN: opt < %s -passes=loop-vectorize -force-vector-width=2 -S | FileCheck %s |
| 2 | + |
| 3 | +@aa = global [256 x [256 x float]] zeroinitializer, align 4 |
| 4 | +@a = global [32000 x float] zeroinitializer, align 4 |
| 5 | + |
| 6 | +;; for (int j = 0; j < 256; j++) |
| 7 | +;; for (int i = j+1; i < 256; i++) |
| 8 | +;; a[i] -= aa[j][i] * a[j]; |
| 9 | + |
| 10 | +; CHECK-NOT: vector.body: |
| 11 | + |
| 12 | +define signext i32 @s115() { |
| 13 | +entry: |
| 14 | + br label %for.body |
| 15 | + |
| 16 | +for.cond.loopexit.loopexit: ; preds = %for.body4 |
| 17 | + br label %for.cond.loopexit |
| 18 | + |
| 19 | +for.cond.loopexit: ; preds = %for.cond.loopexit.loopexit, %for.body |
| 20 | + %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 |
| 21 | + %exitcond28.not = icmp eq i64 %indvars.iv.next27, 256 |
| 22 | + br i1 %exitcond28.not, label %for.cond.cleanup, label %for.body |
| 23 | + |
| 24 | +for.cond.cleanup: ; preds = %for.cond.loopexit |
| 25 | + ret i32 0 |
| 26 | + |
| 27 | +for.body: ; preds = %entry, %for.cond.loopexit |
| 28 | + %indvars.iv26 = phi i64 [ 0, %entry ], [ %indvars.iv.next27, %for.cond.loopexit ] |
| 29 | + %indvars.iv = phi i64 [ 1, %entry ], [ %indvars.iv.next, %for.cond.loopexit ] |
| 30 | + %indvars.iv.next27 = add nuw nsw i64 %indvars.iv26, 1 |
| 31 | + %cmp221 = icmp ult i64 %indvars.iv26, 255 |
| 32 | + br i1 %cmp221, label %for.body4.lr.ph, label %for.cond.loopexit |
| 33 | + |
| 34 | +for.body4.lr.ph: ; preds = %for.body |
| 35 | + %arrayidx8 = getelementptr inbounds [32000 x float], ptr @a, i64 0, i64 %indvars.iv26 |
| 36 | + br label %for.body4 |
| 37 | + |
| 38 | +for.body4: ; preds = %for.body4.lr.ph, %for.body4 |
| 39 | + %indvars.iv24 = phi i64 [ %indvars.iv, %for.body4.lr.ph ], [ %indvars.iv.next25, %for.body4 ] |
| 40 | + %arrayidx6 = getelementptr inbounds [256 x [256 x float]], ptr @aa, i64 0, i64 %indvars.iv26, i64 %indvars.iv24 |
| 41 | + %0 = load float, ptr %arrayidx6, align 4 |
| 42 | + %1 = load float, ptr %arrayidx8, align 4 |
| 43 | + %arrayidx10 = getelementptr inbounds [32000 x float], ptr @a, i64 0, i64 %indvars.iv24 |
| 44 | + %2 = load float, ptr %arrayidx10, align 4 |
| 45 | + %neg = fneg float %0 |
| 46 | + %3 = tail call float @llvm.fmuladd.f32(float %neg, float %1, float %2) |
| 47 | + store float %3, ptr %arrayidx10, align 4 |
| 48 | + %indvars.iv.next25 = add nuw nsw i64 %indvars.iv24, 1 |
| 49 | + %exitcond.not = icmp eq i64 %indvars.iv.next25, 256 |
| 50 | + br i1 %exitcond.not, label %for.cond.loopexit.loopexit, label %for.body4 |
| 51 | +} |
0 commit comments