2015-10-06 23:36:44 +08:00
|
|
|
; RUN: opt %loadPolly -polly-scops -analyze < %s 2>&1 | not FileCheck %s
|
2012-11-02 14:08:39 +08:00
|
|
|
|
|
|
|
;#define TYPE float
|
|
|
|
;#define NUM 4
|
|
|
|
;
|
|
|
|
;TYPE A[NUM];
|
|
|
|
;TYPE B[NUM];
|
|
|
|
;TYPE C[NUM];
|
|
|
|
;
|
|
|
|
;void vector_multiply(void) {
|
|
|
|
; int i;
|
|
|
|
; for (i = 0; i < NUM; i++) {
|
|
|
|
; A[i] = B[i] * C[i];
|
|
|
|
; }
|
|
|
|
;}
|
|
|
|
|
2011-04-29 14:27:02 +08:00
|
|
|
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
|
|
|
|
|
|
|
|
@B = common global [4 x float] zeroinitializer, align 16
|
|
|
|
@C = common global [4 x float] zeroinitializer, align 16
|
|
|
|
@A = common global [4 x float] zeroinitializer, align 16
|
|
|
|
|
|
|
|
define void @vector_multiply() nounwind {
|
|
|
|
bb:
|
|
|
|
br label %bb3
|
|
|
|
|
|
|
|
bb3: ; preds = %bb7, %bb
|
|
|
|
%indvar = phi i64 [ %indvar.next, %bb7 ], [ 0, %bb ]
|
2015-02-28 03:20:19 +08:00
|
|
|
%scevgep = getelementptr [4 x float], [4 x float]* @A, i64 0, i64 %indvar
|
|
|
|
%scevgep1 = getelementptr [4 x float], [4 x float]* @C, i64 0, i64 %indvar
|
|
|
|
%scevgep2 = getelementptr [4 x float], [4 x float]* @B, i64 0, i64 %indvar
|
2011-04-29 14:27:02 +08:00
|
|
|
%exitcond = icmp ne i64 %indvar, 4
|
|
|
|
br i1 %exitcond, label %bb4, label %bb8
|
|
|
|
|
|
|
|
bb4: ; preds = %bb3
|
2015-02-28 05:22:50 +08:00
|
|
|
%tmp = load float, float* %scevgep2, align 4
|
|
|
|
%tmp5 = load float, float* %scevgep1, align 4
|
2011-04-29 14:27:02 +08:00
|
|
|
%tmp6 = fmul float %tmp, %tmp5
|
|
|
|
store float %tmp6, float* %scevgep, align 4
|
|
|
|
br label %bb7
|
|
|
|
|
|
|
|
bb7: ; preds = %bb4
|
|
|
|
%indvar.next = add i64 %indvar, 1
|
|
|
|
br label %bb3
|
|
|
|
|
|
|
|
bb8: ; preds = %bb3
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2015-09-10 23:25:24 +08:00
|
|
|
; Match any reduction type except "[Reduction Type: NONE]"
|
|
|
|
; CHECK: [Reduction Type: {{[^N].*}}]
|