diff options
author | Kit Barton <kbarton@ca.ibm.com> | 2019-12-16 11:57:52 -0500 |
---|---|---|
committer | Kit Barton <kbarton@ca.ibm.com> | 2019-12-16 15:17:29 -0500 |
commit | ff07fc66d9eef577f3b44716f72e581a18cd9ac9 (patch) | |
tree | e9f549760494d170726581dfd363ccaaa4296ba0 /llvm/lib/Transforms/Scalar/LoopFuse.cpp | |
parent | 02f644c59ad0d480285b569a0c5ecbd038866ce8 (diff) | |
download | llvm-ff07fc66d9eef577f3b44716f72e581a18cd9ac9.zip llvm-ff07fc66d9eef577f3b44716f72e581a18cd9ac9.tar.gz llvm-ff07fc66d9eef577f3b44716f72e581a18cd9ac9.tar.bz2 |
[LoopFusion] Restrict loop fusion to rotated loops.
Summary:
This patch restricts loop fusion to only consider rotated loops as valid candidates.
This simplifies the analysis and transformation and aligns with other loop optimizations.
Reviewers: jdoerfert, Meinersbur, dmgreen, etiotto, Whitney, fhahn, hfinkel
Reviewed By: Meinersbur
Subscribers: ormris, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71025
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopFuse.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/LoopFuse.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopFuse.cpp b/llvm/lib/Transforms/Scalar/LoopFuse.cpp index 2bbbd7c..e5ea914 100644 --- a/llvm/lib/Transforms/Scalar/LoopFuse.cpp +++ b/llvm/lib/Transforms/Scalar/LoopFuse.cpp @@ -91,6 +91,7 @@ STATISTIC(FusionNotBeneficial, "Fusion is not beneficial"); STATISTIC(NonIdenticalGuards, "Candidates have different guards"); STATISTIC(NonEmptyExitBlock, "Candidate has a non-empty exit block"); STATISTIC(NonEmptyGuardBlock, "Candidate has a non-empty guard block"); +STATISTIC(NotRotated, "Candidate is not rotated"); enum FusionDependenceAnalysisChoice { FUSION_DEPENDENCE_ANALYSIS_SCEV, @@ -319,6 +320,11 @@ struct FusionCandidate { return reportInvalidCandidate(NotSimplifiedForm); } + if (!isRotated()) { + LLVM_DEBUG(dbgs() << "Loop " << L->getName() << " is not rotated!\n"); + return reportInvalidCandidate(NotRotated); + } + return true; } |