2015-10-06 23:36:44 +08:00
|
|
|
; RUN: opt %loadPolly -polly-allow-nonaffine -polly-dce -polly-ast -analyze < %s | FileCheck %s
|
2014-07-11 15:12:10 +08:00
|
|
|
;
|
2015-01-02 07:01:11 +08:00
|
|
|
; CHECK: for (int c0 = 0; c0 <= 1023; c0 += 1)
|
2014-07-11 15:12:10 +08:00
|
|
|
;
|
|
|
|
; void f(int *A) {
|
|
|
|
; for (int i = 0; i < 1024; i++)
|
2015-06-24 04:55:05 +08:00
|
|
|
; A[bar(i)] = i;
|
2014-07-11 15:12:10 +08:00
|
|
|
; }
|
|
|
|
;
|
|
|
|
target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
|
|
|
|
|
2015-06-24 04:55:05 +08:00
|
|
|
declare i32 @bar(i32) #1
|
|
|
|
|
2014-07-11 15:12:10 +08:00
|
|
|
define void @f(i32* %A) {
|
|
|
|
entry:
|
|
|
|
br label %for.cond
|
|
|
|
|
|
|
|
for.cond: ; preds = %for.inc, %entry
|
|
|
|
%i.0 = phi i32 [ 0, %entry ], [ %inc, %for.inc ]
|
|
|
|
%exitcond = icmp ne i32 %i.0, 1024
|
|
|
|
br i1 %exitcond, label %for.body, label %for.end
|
|
|
|
|
|
|
|
for.body: ; preds = %for.cond
|
2015-06-24 04:55:05 +08:00
|
|
|
%nonaff = call i32 @bar(i32 %i.0)
|
|
|
|
%arrayidx = getelementptr inbounds i32, i32* %A, i32 %nonaff
|
2014-07-11 15:12:10 +08:00
|
|
|
store i32 %i.0, i32* %arrayidx, align 4
|
|
|
|
br label %for.inc
|
|
|
|
|
|
|
|
for.inc: ; preds = %for.body
|
|
|
|
%inc = add nsw i32 %i.0, 1
|
|
|
|
br label %for.cond
|
|
|
|
|
|
|
|
for.end: ; preds = %for.cond
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2015-06-24 04:55:05 +08:00
|
|
|
attributes #1 = { nounwind readnone }
|