Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
test/ScopDetect/non_affine_but_modulo_access.ll
- This file was copied from test/ScopInfo/reduction_alternating_base.ll.
; RUN: opt %loadPolly -polly-scops -analyze < %s | FileCheck %s | ; RUN: opt %loadPolly -polly-detect -analyze < %s | FileCheck %s | ||||
; | ; | ||||
; FIXME: We cannot detect this SCoP yet but as soon as we can we should check | ; CHECK: Valid Region for Scop: | ||||
; that the reduction is detected! | |||||
; | ; | ||||
; CHECK-NOT: Scattering | ; void jd(int *A) { | ||||
; | |||||
; void f(int *A) { | |||||
; for (int i = 0; i < 1024; i++) | ; for (int i = 0; i < 1024; i++) | ||||
; A[i % 2] += i; | ; A[i % 2] = A[i % 2 + 1]; | ||||
; } | ; } | ||||
; | ; | ||||
target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64" | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" | ||||
define void @f(i32* %A) { | define void @jd(i32* %A) { | ||||
entry: | entry: | ||||
br label %for.cond | br label %for.cond | ||||
for.cond: ; preds = %for.inc, %entry | for.cond: ; preds = %for.inc, %entry | ||||
%i.0 = phi i32 [ 0, %entry ], [ %inc, %for.inc ] | %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.inc ] | ||||
%exitcond = icmp ne i32 %i.0, 1024 | %exitcond = icmp ne i32 %i.0, 1024 | ||||
br i1 %exitcond, label %for.body, label %for.end | br i1 %exitcond, label %for.body, label %for.end | ||||
for.body: ; preds = %for.cond | for.body: ; preds = %for.cond | ||||
%rem = srem i32 %i.0, 2 | %rem = srem i32 %i.0, 2 | ||||
%arrayidx = getelementptr inbounds i32* %A, i32 %rem | %add = add nsw i32 %rem, 1 | ||||
%idxprom = sext i32 %add to i64 | |||||
%arrayidx = getelementptr inbounds i32* %A, i64 %idxprom | |||||
%tmp = load i32* %arrayidx, align 4 | %tmp = load i32* %arrayidx, align 4 | ||||
%add = add nsw i32 %tmp, %i.0 | %rem1 = srem i32 %i.0, 2 | ||||
store i32 %add, i32* %arrayidx, align 4 | %idxprom2 = sext i32 %rem1 to i64 | ||||
%arrayidx3 = getelementptr inbounds i32* %A, i64 %idxprom2 | |||||
store i32 %tmp, i32* %arrayidx3, align 4 | |||||
br label %for.inc | br label %for.inc | ||||
for.inc: ; preds = %for.body | for.inc: ; preds = %for.body | ||||
%inc = add nsw i32 %i.0, 1 | %inc = add nsw i32 %i.0, 1 | ||||
br label %for.cond | br label %for.cond | ||||
for.end: ; preds = %for.cond | for.end: ; preds = %for.cond | ||||
ret void | ret void | ||||
} | } |