summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2018-02-22 12:53:02 +0000
committerHans Wennborg <hans@hanshq.net>2018-02-22 12:53:02 +0000
commit5d413c4a80edad74d83341b0c2568ce0411ce829 (patch)
treecdc44cfddbf38ea13274b815e9a8e47a0f017263 /lib
parenta1f4098730e17f8a905fe823395f124ecf889d01 (diff)
Merging r325687:
------------------------------------------------------------------------ r325687 | sbaranga | 2018-02-21 16:20:32 +0100 (Wed, 21 Feb 2018) | 8 lines [SCEV] Temporarily disable loop versioning for the purpose of turning SCEVUnknowns of PHIs into AddRecExprs. This feature is now hidden behind the -scev-version-unknown flag. Fixes PR36032 and PR35432. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_60@325773 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Analysis/ScalarEvolution.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp
index 10b5c74e378..bfff7afb5b4 100644
--- a/lib/Analysis/ScalarEvolution.cpp
+++ b/lib/Analysis/ScalarEvolution.cpp
@@ -205,6 +205,11 @@ static cl::opt<unsigned>
cl::desc("Max coefficients in AddRec during evolving"),
cl::init(16));
+static cl::opt<bool> VersionUnknown(
+ "scev-version-unknown", cl::Hidden,
+ cl::desc("Use predicated scalar evolution to version SCEVUnknowns"),
+ cl::init(false));
+
//===----------------------------------------------------------------------===//
// SCEV class definitions
//===----------------------------------------------------------------------===//
@@ -11467,6 +11472,8 @@ private:
// couldn't create an AddRec for it, or couldn't add the predicate), we just
// return \p Expr.
const SCEV *convertToAddRecWithPreds(const SCEVUnknown *Expr) {
+ if (!VersionUnknown)
+ return Expr;
if (!isa<PHINode>(Expr->getValue()))
return Expr;
Optional<std::pair<const SCEV *, SmallVector<const SCEVPredicate *, 3>>>