diff options
| author | Johannes Doerfert <doerfert@cs.uni-saarland.de> | 2016-06-06 12:16:10 +0000 |
|---|---|---|
| committer | Johannes Doerfert <doerfert@cs.uni-saarland.de> | 2016-06-06 12:16:10 +0000 |
| commit | 1a6b0f7f078818e3b8780c7dfe5eec3f488ff99d (patch) | |
| tree | 637f99c5db233153afc56ceef025206bc3955740 | |
| parent | 6a6a671c72972d7777f28d944f4f5a1e34a76fe1 (diff) | |
| download | bcm5719-llvm-1a6b0f7f078818e3b8780c7dfe5eec3f488ff99d.tar.gz bcm5719-llvm-1a6b0f7f078818e3b8780c7dfe5eec3f488ff99d.zip | |
[NFC] Refactor assumption tracking interface
llvm-svn: 271890
| -rw-r--r-- | polly/include/polly/ScopInfo.h | 9 | ||||
| -rw-r--r-- | polly/lib/Analysis/ScopInfo.cpp | 32 |
2 files changed, 27 insertions, 14 deletions
diff --git a/polly/include/polly/ScopInfo.h b/polly/include/polly/ScopInfo.h index 5be3a742544..a66e2130ddb 100644 --- a/polly/include/polly/ScopInfo.h +++ b/polly/include/polly/ScopInfo.h @@ -1942,6 +1942,15 @@ public: /// @returns True if the optimized SCoP can be executed. bool hasFeasibleRuntimeContext() const; + /// @brief Check if the assumption in @p Set is trivial or not. + /// + /// @param Set The relations between parameters that are assumed to hold. + /// @param Sign Enum to indicate if the assumptions in @p Set are positive + /// (needed/assumptions) or negative (invalid/restrictions). + /// + /// @returns True if the assumption @p Set is not trivial. + bool isEffectiveAssumption(__isl_keep isl_set *Set, AssumptionSign Sign); + /// @brief Track and report an assumption. /// /// Use 'clang -Rpass-analysis=polly-scops' or 'opt diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp index 84e56b5c5c1..627fc56d8e7 100644 --- a/polly/lib/Analysis/ScopInfo.cpp +++ b/polly/lib/Analysis/ScopInfo.cpp @@ -3678,23 +3678,27 @@ static std::string toString(AssumptionKind Kind) { llvm_unreachable("Unknown AssumptionKind!"); } -bool Scop::trackAssumption(AssumptionKind Kind, __isl_keep isl_set *Set, - DebugLoc Loc, AssumptionSign Sign) { - if (PollyRemarksMinimal) { - if (Sign == AS_ASSUMPTION) { - if (isl_set_is_subset(Context, Set)) - return false; +bool Scop::isEffectiveAssumption(__isl_keep isl_set *Set, AssumptionSign Sign) { + if (Sign == AS_ASSUMPTION) { + if (isl_set_is_subset(Context, Set)) + return false; - if (isl_set_is_subset(AssumedContext, Set)) - return false; - } else { - if (isl_set_is_disjoint(Set, Context)) - return false; + if (isl_set_is_subset(AssumedContext, Set)) + return false; + } else { + if (isl_set_is_disjoint(Set, Context)) + return false; - if (isl_set_is_subset(Set, InvalidContext)) - return false; - } + if (isl_set_is_subset(Set, InvalidContext)) + return false; } + return true; +} + +bool Scop::trackAssumption(AssumptionKind Kind, __isl_keep isl_set *Set, + DebugLoc Loc, AssumptionSign Sign) { + if (PollyRemarksMinimal && !isEffectiveAssumption(Set, Sign)) + return false; auto &F = getFunction(); auto Suffix = Sign == AS_ASSUMPTION ? " assumption:\t" : " restriction:\t"; |

