[polly] r287271 - [NFC] Add flag to disable error block assumptions
Johannes Doerfert via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 17 14:16:35 PST 2016
Author: jdoerfert
Date: Thu Nov 17 16:16:35 2016
New Revision: 287271
URL: http://llvm.org/viewvc/llvm-project?rev=287271&view=rev
Log:
[NFC] Add flag to disable error block assumptions
The declaration as an "error block" is currently aggressive and not very
smart. This patch allows to disable error blocks completely. This might
be useful to prevent SCoP expansion to a point where the assumed context
becomes infeasible, thus the SCoP has to be discarded.
Modified:
polly/trunk/lib/Support/ScopHelper.cpp
Modified: polly/trunk/lib/Support/ScopHelper.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Support/ScopHelper.cpp?rev=287271&r1=287270&r2=287271&view=diff
==============================================================================
--- polly/trunk/lib/Support/ScopHelper.cpp (original)
+++ polly/trunk/lib/Support/ScopHelper.cpp Thu Nov 17 16:16:35 2016
@@ -30,6 +30,11 @@ using namespace polly;
#define DEBUG_TYPE "polly-scop-helper"
+static cl::opt<bool> PollyAllowErrorBlocks(
+ "polly-allow-error-blocks",
+ cl::desc("Allow to speculate on the execution of 'error blocks'."),
+ cl::Hidden, cl::init(true), cl::ZeroOrMore, cl::cat(PollyCategory));
+
bool polly::hasInvokeEdge(const PHINode *PN) {
for (unsigned i = 0, e = PN->getNumIncomingValues(); i < e; ++i)
if (InvokeInst *II = dyn_cast<InvokeInst>(PN->getIncomingValue(i)))
@@ -372,6 +377,8 @@ Value *polly::expandCodeFor(Scop &S, Sca
bool polly::isErrorBlock(BasicBlock &BB, const Region &R, LoopInfo &LI,
const DominatorTree &DT) {
+ if (!PollyAllowErrorBlocks)
+ return false;
if (isa<UnreachableInst>(BB.getTerminator()))
return true;
More information about the llvm-commits
mailing list