Changeset View
Changeset View
Standalone View
Standalone View
test/Isl/CodeGen/no_guard_after_tiling.ll
- This file was added.
; RUN: opt %loadPolly -polly-opt-isl -polly-codegen-isl -S < %s | FileCheck %s | |||||
; | |||||
; When we use isl to compute the loop bound we can show that even after tiling | |||||
; only one loop guards is needed. ScalarEvolution can't figure that out and | |||||
; places at least two. | |||||
; | |||||
; CHECK: br i1 %polly.{{[._a-zA-Z0-9]*}}guard | |||||
; CHECK-NOT: br i1 %polly.{{[._a-zA-Z0-9]*}}guard | |||||
; | |||||
; void jd(int *A) { | |||||
; for (int i = 0; i < 1024; i++) | |||||
; for (int j = 0; j < 1024; j++) | |||||
; A[j] = A[j - 1] + i * j; | |||||
; } | |||||
; | |||||
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" | |||||
define void @jd(i32* %A) { | |||||
entry: | |||||
br label %for.cond | |||||
for.cond: ; preds = %for.inc6, %entry | |||||
%indvars.iv3 = phi i64 [ %indvars.iv.next4, %for.inc6 ], [ 0, %entry ] | |||||
%exitcond5 = icmp ne i64 %indvars.iv3, 1024 | |||||
br i1 %exitcond5, label %for.body, label %for.end8 | |||||
for.body: ; preds = %for.cond | |||||
br label %for.cond1 | |||||
for.cond1: ; preds = %for.inc, %for.body | |||||
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %for.body ] | |||||
%exitcond = icmp ne i64 %indvars.iv, 1024 | |||||
br i1 %exitcond, label %for.body3, label %for.end | |||||
for.body3: ; preds = %for.cond1 | |||||
%tmp = add nsw i64 %indvars.iv, -1 | |||||
%arrayidx = getelementptr inbounds i32* %A, i64 %tmp | |||||
%tmp6 = load i32* %arrayidx, align 4 | |||||
%tmp7 = mul nsw i64 %indvars.iv3, %indvars.iv | |||||
%tmp8 = trunc i64 %tmp7 to i32 | |||||
%add = add nsw i32 %tmp6, %tmp8 | |||||
%arrayidx5 = getelementptr inbounds i32* %A, i64 %indvars.iv | |||||
store i32 %add, i32* %arrayidx5, align 4 | |||||
br label %for.inc | |||||
for.inc: ; preds = %for.body3 | |||||
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 | |||||
br label %for.cond1 | |||||
for.end: ; preds = %for.cond1 | |||||
br label %for.inc6 | |||||
for.inc6: ; preds = %for.end | |||||
%indvars.iv.next4 = add nuw nsw i64 %indvars.iv3, 1 | |||||
br label %for.cond | |||||
for.end8: ; preds = %for.cond | |||||
ret void | |||||
} |