Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow to generate a loop without the GuardBB
This allows us to omit the GuardBB in front of created loops if we can show the loop trip count is at least one. It also simplifies the dominance relation inside the new created region. A GuardBB (even with a constant branch condition) might trigger false dominance errors during function verification. Differential Revision: http://reviews.llvm.org/D5297 llvm-svn: 217525
- Loading branch information
Johannes Doerfert
committed
Sep 10, 2014
1 parent
1c9547e
commit dd5c144
Showing
4 changed files
with
91 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
; RUN: opt %loadPolly -polly-codegen-isl -S < %s | FileCheck %s | ||
; | ||
; CHECK-NOT: br i1 true, label %polly.{{.*}}, label %polly.{{.*}} | ||
; | ||
; void jd(int *A) { | ||
; for (int i = 0; i < 1024; i++) | ||
; A[i] = i; | ||
; } | ||
; | ||
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.inc, %entry | ||
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] | ||
%exitcond = icmp ne i64 %indvars.iv, 1024 | ||
br i1 %exitcond, label %for.body, label %for.end | ||
|
||
for.body: ; preds = %for.cond | ||
%arrayidx = getelementptr inbounds i32* %A, i64 %indvars.iv | ||
%tmp = trunc i64 %indvars.iv to i32 | ||
store i32 %tmp, i32* %arrayidx, align 4 | ||
br label %for.inc | ||
|
||
for.inc: ; preds = %for.body | ||
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 | ||
br label %for.cond | ||
|
||
for.end: ; preds = %for.cond | ||
ret void | ||
} |