diff --git a/polly/lib/Transform/ForwardOpTree.cpp b/polly/lib/Transform/ForwardOpTree.cpp index 733b4d689e9d..6a68581d6899 100644 --- a/polly/lib/Transform/ForwardOpTree.cpp +++ b/polly/lib/Transform/ForwardOpTree.cpp @@ -51,7 +51,7 @@ static cl::opt cl::desc("Analyze array contents for load forwarding"), cl::cat(PollyCategory), cl::init(true), cl::Hidden); -static cl::opt +static cl::opt MaxOps("polly-optree-max-ops", cl::desc("Maximum number of ISL operations to invest for known " "analysis; 0=no limit"), diff --git a/polly/lib/Transform/ZoneAlgo.cpp b/polly/lib/Transform/ZoneAlgo.cpp index d8dcd4096fe5..1376bf111a76 100644 --- a/polly/lib/Transform/ZoneAlgo.cpp +++ b/polly/lib/Transform/ZoneAlgo.cpp @@ -422,7 +422,7 @@ isl::map ZoneAlgorithm::getWrittenValue(MemoryAccess *MA, isl::map AccRel) { : Stmt->getSurroundingLoop(); if (AccVal && AccVal->getType() == MA->getLatestScopArrayInfo()->getElementType() && - AccRel.is_single_valued()) + AccRel.is_single_valued().is_true()) return makeValInst(AccVal, Stmt, L); // memset(_, '0', ) is equivalent to writing the null value to all touched diff --git a/polly/test/ForwardOpTree/noforward_outofquota.ll b/polly/test/ForwardOpTree/noforward_outofquota.ll new file mode 100644 index 000000000000..d43025096666 --- /dev/null +++ b/polly/test/ForwardOpTree/noforward_outofquota.ll @@ -0,0 +1,48 @@ +; RUN: opt %loadPolly -polly-optree-max-ops=1 -polly-optree -analyze < %s | FileCheck %s -match-full-lines +; RUN: opt %loadPolly -polly-optree-max-ops=1 -polly-optree -disable-output -stats < %s 2>&1 | FileCheck %s -match-full-lines -check-prefix=STATS +; REQUIRES: asserts +; +; for (int j = 0; j < n; j += 1) { +; bodyA: +; double val = B[j]; +; +; bodyB: +; A[j] = val; +; } +; +define void @func(i32 %n, double* noalias nonnull %A, double* noalias nonnull %B) { +entry: + br label %for + +for: + %j = phi i32 [0, %entry], [%j.inc, %inc] + %j.cmp = icmp slt i32 %j, %n + br i1 %j.cmp, label %bodyA, label %exit + + bodyA: + %B_idx = getelementptr inbounds double, double* %B, i32 %j + %val = load double, double* %B_idx + br label %bodyB + + bodyB: + %A_idx = getelementptr inbounds double, double* %A, i32 %j + store double %val, double* %A_idx + br label %inc + +inc: + %j.inc = add nuw nsw i32 %j, 1 + br label %for + +exit: + br label %return + +return: + ret void +} + + +; CHECK: ForwardOpTree executed, but did not modify anything + +; STATS-NOT: IMPLEMENTATION ERROR: Unhandled error state +; STATS: 1 polly-optree - Analyses aborted because max_operations was reached +; STATS-NOT: IMPLEMENTATION ERROR: Unhandled error state