ScheduleOptimizer: Do not get dependences, if we do not calculate a schedule

This solves the 'isl_ctx freed, but some objects still reference it' problem
reported in PR12276.

llvm-svn: 152917
This commit is contained in:
Tobias Grosser
2012-03-16 11:51:41 +00:00
parent 16d5af118c
commit 8a5070213a
2 changed files with 20 additions and 2 deletions

View File

@@ -447,13 +447,14 @@ bool IslScheduleOptimizer::runOnScop(Scop &S) {
}
isl_union_map *Validity = D->getDependences(ValidityKinds);
isl_union_map *Proximity = D->getDependences(ProximityKinds);
isl_union_set *Domain = S.getDomains();
if (!Domain)
return false;
isl_union_map *Validity = D->getDependences(ValidityKinds);
isl_union_map *Proximity = D->getDependences(ProximityKinds);
// Simplify the dependences by removing the constraints introduced by the
// domains. This can speed up the scheduling time significantly, as large
// constant coefficients will be removed from the dependences. The

View File

@@ -0,0 +1,17 @@
; RUN: opt %loadPolly -polly-opt-isl -S %s
target datalayout = "e-p:32:32:32-i64:64:64-i32:32:32-i16:16:16-i1:32:32f64:64:64-f32:32:32-a0:0-n32"
target triple = "hexagon-unknown-linux-gnu"
define void @sdbout_label() nounwind {
entry:
br label %for.cond
for.cond: ; preds = %for.cond, %entry
%0 = phi i32 [ 0, %entry ], [ %1, %for.cond ]
%1 = add nsw i32 %0, 1
%exitcond72 = icmp eq i32 %1, 7
br i1 %exitcond72, label %sw.epilog66, label %for.cond
sw.epilog66: ; preds = %for.cond
ret void
}