diff options
| author | Johannes Doerfert <doerfert@cs.uni-saarland.de> | 2016-12-02 17:55:41 +0000 |
|---|---|---|
| committer | Johannes Doerfert <doerfert@cs.uni-saarland.de> | 2016-12-02 17:55:41 +0000 |
| commit | bda814350a00cbc10bece812910220cf19e5192a (patch) | |
| tree | 521c6704b6985fbd2a8213f487d6ae7ac307fb02 /polly/lib/Analysis/ScopDetection.cpp | |
| parent | fc9e246463f0605e424eda14493592cdcf3bb9bf (diff) | |
| download | bcm5719-llvm-bda814350a00cbc10bece812910220cf19e5192a.tar.gz bcm5719-llvm-bda814350a00cbc10bece812910220cf19e5192a.zip | |
Allow to disable unsigned operations (zext, icmp ugt, ...)
Unsigned operations are often useful to support but the heuristics are
not yet tuned. This options allows to disable them if necessary.
llvm-svn: 288521
Diffstat (limited to 'polly/lib/Analysis/ScopDetection.cpp')
| -rw-r--r-- | polly/lib/Analysis/ScopDetection.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/polly/lib/Analysis/ScopDetection.cpp b/polly/lib/Analysis/ScopDetection.cpp index 756cb5d6d68..60911a7e5b9 100644 --- a/polly/lib/Analysis/ScopDetection.cpp +++ b/polly/lib/Analysis/ScopDetection.cpp @@ -109,6 +109,13 @@ static cl::opt<bool> cl::Hidden, cl::init(false), cl::ZeroOrMore, cl::cat(PollyCategory)); +bool polly::PollyAllowUnsignedOperations; +static cl::opt<bool, true> XPollyAllowUnsignedOperations( + "polly-allow-unsigned-operations", + cl::desc("Allow unsigned operations such as comparisons or zero-extends."), + cl::location(PollyAllowUnsignedOperations), cl::Hidden, cl::ZeroOrMore, + cl::init(true), cl::cat(PollyCategory)); + bool polly::PollyUseRuntimeAliasChecks; static cl::opt<bool, true> XPollyUseRuntimeAliasChecks( "polly-use-runtime-alias-checks", @@ -454,6 +461,11 @@ bool ScopDetection::isValidBranch(BasicBlock &BB, BranchInst *BI, const SCEV *LHS = SE->getSCEVAtScope(ICmp->getOperand(0), L); const SCEV *RHS = SE->getSCEVAtScope(ICmp->getOperand(1), L); + // If unsigned operations are not allowed try to approximate the region. + if (ICmp->isUnsigned() && !PollyAllowUnsignedOperations) + return !IsLoopBranch && AllowNonAffineSubRegions && + addOverApproximatedRegion(RI->getRegionFor(&BB), Context); + // Check for invalid usage of different pointers in one expression. if (ICmp->isEquality() && involvesMultiplePtrs(LHS, nullptr, L) && involvesMultiplePtrs(RHS, nullptr, L)) |

