[llvm] r325687 - [SCEV] Temporarily disable loop versioning for the purpose
Silviu Baranga via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 21 07:20:32 PST 2018
Author: sbaranga
Date: Wed Feb 21 07:20:32 2018
New Revision: 325687
URL: http://llvm.org/viewvc/llvm-project?rev=325687&view=rev
Log:
[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.
Modified:
llvm/trunk/lib/Analysis/ScalarEvolution.cpp
llvm/trunk/test/Transforms/LoopVectorize/pr30654-phiscev-sext-trunc.ll
llvm/trunk/test/Transforms/LoopVectorize/pr35773.ll
llvm/trunk/test/Transforms/LoopVectorize/vect-phiscev-sext-trunc.ll
Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=325687&r1=325686&r2=325687&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Wed Feb 21 07:20:32 2018
@@ -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
//===----------------------------------------------------------------------===//
@@ -11573,6 +11578,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>>>
Modified: llvm/trunk/test/Transforms/LoopVectorize/pr30654-phiscev-sext-trunc.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopVectorize/pr30654-phiscev-sext-trunc.ll?rev=325687&r1=325686&r2=325687&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/LoopVectorize/pr30654-phiscev-sext-trunc.ll (original)
+++ llvm/trunk/test/Transforms/LoopVectorize/pr30654-phiscev-sext-trunc.ll Wed Feb 21 07:20:32 2018
@@ -1,4 +1,4 @@
-; RUN: opt -S -loop-vectorize -force-vector-width=4 -force-vector-interleave=1 < %s 2>&1 | FileCheck %s
+; RUN: opt -S -loop-vectorize -force-vector-width=4 -force-vector-interleave=1 -scev-version-unknown < %s 2>&1 | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
Modified: llvm/trunk/test/Transforms/LoopVectorize/pr35773.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopVectorize/pr35773.ll?rev=325687&r1=325686&r2=325687&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/LoopVectorize/pr35773.ll (original)
+++ llvm/trunk/test/Transforms/LoopVectorize/pr35773.ll Wed Feb 21 07:20:32 2018
@@ -1,4 +1,4 @@
-; RUN: opt -S -loop-vectorize -force-vector-width=4 -force-vector-interleave=1 < %s 2>&1 | FileCheck %s
+; RUN: opt -S -loop-vectorize -force-vector-width=4 -force-vector-interleave=1 -scev-version-unknown < %s 2>&1 | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
@a = common local_unnamed_addr global i32 0, align 4
@b = common local_unnamed_addr global i8 0, align 1
Modified: llvm/trunk/test/Transforms/LoopVectorize/vect-phiscev-sext-trunc.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopVectorize/vect-phiscev-sext-trunc.ll?rev=325687&r1=325686&r2=325687&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/LoopVectorize/vect-phiscev-sext-trunc.ll (original)
+++ llvm/trunk/test/Transforms/LoopVectorize/vect-phiscev-sext-trunc.ll Wed Feb 21 07:20:32 2018
@@ -1,5 +1,5 @@
-; RUN: opt -S -loop-vectorize -force-vector-width=8 -force-vector-interleave=1 < %s | FileCheck %s -check-prefix=VF8
-; RUN: opt -S -loop-vectorize -force-vector-width=1 -force-vector-interleave=4 < %s | FileCheck %s -check-prefix=VF1
+; RUN: opt -S -loop-vectorize -force-vector-width=8 -force-vector-interleave=1 -scev-version-unknown < %s | FileCheck %s -check-prefix=VF8
+; RUN: opt -S -loop-vectorize -force-vector-width=1 -force-vector-interleave=4 -scev-version-unknown < %s | FileCheck %s -check-prefix=VF1
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
More information about the llvm-commits
mailing list