-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow PHI nodes in the region exit block
While we do not need to model PHI nodes in the region exit (as it is not part of the SCoP), we need to prepare for the case that the exit block is split in code generation to create a single exiting block. If this will happen, hence if the region did not have a single exiting block before, we will model the operands of the PHI nodes as escaping scalars in the SCoP. Differential Revision: http://reviews.llvm.org/D12051 llvm-svn: 247078
- Loading branch information
Johannes Doerfert
committed
Sep 8, 2015
1 parent
b9fe03d
commit 717b866
Showing
23 changed files
with
534 additions
and
63 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
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
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,42 @@ | ||
; RUN: opt %loadPolly -polly-detect-unprofitable -polly-codegen -polly-no-early-exit -S < %s | FileCheck %s | ||
; | ||
; This caused an lnt crash at some point, just verify it will run through. | ||
; | ||
; CHECK-LABEL: polly.merge_new_and_old: | ||
; CHECK-NEXT: br label %for.body.6 | ||
; | ||
; CHECK-LABEL: for.body.6: | ||
; CHECK-NEXT: %i.14 = phi i32 [ undef, %for.body.6 ], [ 0, %polly.merge_new_and_old ] | ||
; | ||
@recd = external hidden global [255 x i32], align 16 | ||
|
||
define void @rsdec_204(i8* %data_in) { | ||
entry: | ||
br i1 undef, label %if.then, label %for.body | ||
|
||
if.then: ; preds = %entry | ||
unreachable | ||
|
||
for.body: ; preds = %for.body, %entry | ||
%i.05 = phi i32 [ %inc, %for.body ], [ 0, %entry ] | ||
%arrayidx = getelementptr inbounds i8, i8* %data_in, i64 0 | ||
%0 = load i8, i8* %arrayidx, align 1 | ||
%conv = zext i8 %0 to i32 | ||
%arrayidx2 = getelementptr inbounds [255 x i32], [255 x i32]* @recd, i64 0, i64 0 | ||
store i32 %conv, i32* %arrayidx2, align 4 | ||
%inc = add nuw nsw i32 %i.05, 1 | ||
br i1 false, label %for.body, label %for.body.6 | ||
|
||
for.body.6: ; preds = %for.body.6, %for.body | ||
%i.14 = phi i32 [ undef, %for.body.6 ], [ 0, %for.body ] | ||
br i1 undef, label %for.body.6, label %for.body.16 | ||
|
||
for.body.16: ; preds = %for.body.16, %for.body.6 | ||
br i1 undef, label %for.body.16, label %for.body.29 | ||
|
||
for.body.29: ; preds = %for.body.29, %for.body.16 | ||
br i1 undef, label %for.body.29, label %for.end.38 | ||
|
||
for.end.38: ; preds = %for.body.29 | ||
unreachable | ||
} |
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,48 @@ | ||
; RUN: opt %loadPolly -polly-detect-unprofitable -polly-codegen -polly-no-early-exit -S < %s | FileCheck %s | ||
; | ||
; This caused an lnt crash at some point, just verify it will run through and | ||
; produce the PHI node in the exit we are looking for. | ||
; | ||
; CHECK: %eps1.addr.0.s2a = alloca double | ||
; CHECK-NOT: %eps1.addr.0.ph.s2a = alloca double | ||
; | ||
; CHECK-LABEL: polly.merge_new_and_old: | ||
; CHECK: %eps1.addr.0.ph.merge = phi double [ %eps1.addr.0.ph.final_reload, %polly.stmt.if.end.47.region_exiting.exit ], [ %eps1.addr.0.ph, %if.end.47.region_exiting ] | ||
; | ||
; CHECK-LABEL: polly.start: | ||
; CHECK-NEXT: store double %eps1, double* %eps1.s2a | ||
; | ||
; CHECK-LABEL: polly.stmt.if.end.47.region_exiting.exit: | ||
; CEHCK-NEXT: %eps1.addr.0.ph.final_reload = load double, double* %eps1.addr.0.s2a | ||
; | ||
define void @dbisect(double* %c, double* %b, double %eps1, double* %eps2) { | ||
entry: | ||
br label %entry.split | ||
|
||
entry.split: ; preds = %entry | ||
store double 0.000000e+00, double* %b, align 8 | ||
br i1 false, label %for.inc, label %for.end | ||
|
||
if.end: ; preds = %if.then, %for.body | ||
%arrayidx33 = getelementptr inbounds double, double* %c, i64 0 | ||
%0 = load double, double* %arrayidx33, align 8 | ||
br label %for.inc | ||
|
||
for.inc: ; preds = %if.then.36, %if.end | ||
br i1 false, label %if.end, label %for.cond.for.end_crit_edge | ||
|
||
for.cond.for.end_crit_edge: ; preds = %for.inc | ||
br label %for.end | ||
|
||
for.end: ; preds = %for.cond.for.end_crit_edge, %entry.split | ||
%cmp45 = fcmp ugt double %eps1, 0.000000e+00 | ||
br i1 %cmp45, label %if.end.47, label %if.then.46 | ||
|
||
if.then.46: ; preds = %for.end | ||
%1 = load double, double* %eps2, align 8 | ||
br label %if.end.47 | ||
|
||
if.end.47: ; preds = %if.then.46, %for.end | ||
%eps1.addr.0 = phi double [ %1, %if.then.46 ], [ %eps1, %for.end ] | ||
ret void | ||
} |
Oops, something went wrong.