summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKit Barton <kbarton@ca.ibm.com>2019-12-16 16:37:30 -0500
committerKit Barton <kbarton@ca.ibm.com>2019-12-18 15:04:25 -0500
commit3db1cf7a1e6731a02b475bdda05ea2d38f3e5ea8 (patch)
treea26d9f525448461b0fd2155816b224a62bf5b8e0
parent3d29c41ad59e2e783da43a8b30a3f4f2d0c78a72 (diff)
downloadbcm5719-llvm-3db1cf7a1e6731a02b475bdda05ea2d38f3e5ea8.tar.gz
bcm5719-llvm-3db1cf7a1e6731a02b475bdda05ea2d38f3e5ea8.zip
[LoopFusion] Use the LoopInfo::isRotatedForm method (NFC).
Loop fusion previously had a method to check whether a loop was in rotated form. This method has been moved into the LoopInfo class. This patch removes the old isRotated method from loop fusion, in favour of the new one in LoopInfo.
-rw-r--r--llvm/lib/Transforms/Scalar/LoopFuse.cpp18
1 files changed, 3 insertions, 15 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopFuse.cpp b/llvm/lib/Transforms/Scalar/LoopFuse.cpp
index a7f4242853f..b17b243d8a3 100644
--- a/llvm/lib/Transforms/Scalar/LoopFuse.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopFuse.cpp
@@ -167,14 +167,8 @@ struct FusionCandidate {
const PostDominatorTree *PDT, OptimizationRemarkEmitter &ORE)
: Preheader(L->getLoopPreheader()), Header(L->getHeader()),
ExitingBlock(L->getExitingBlock()), ExitBlock(L->getExitBlock()),
- Latch(L->getLoopLatch()), L(L), Valid(true), GuardBranch(nullptr),
- DT(DT), PDT(PDT), ORE(ORE) {
-
- // TODO: This is temporary while we fuse both rotated and non-rotated
- // loops. Once we switch to only fusing rotated loops, the initialization of
- // GuardBranch can be moved into the initialization list above.
- if (isRotated())
- GuardBranch = L->getLoopGuardBranch();
+ Latch(L->getLoopLatch()), L(L), Valid(true),
+ GuardBranch(L->getLoopGuardBranch()), DT(DT), PDT(PDT), ORE(ORE) {
// Walk over all blocks in the loop and check for conditions that may
// prevent fusion. For each block, walk over all instructions and collect
@@ -261,12 +255,6 @@ struct FusionCandidate {
: GuardBranch->getSuccessor(0);
}
- bool isRotated() const {
- assert(L && "Expecting loop to be valid.");
- assert(Latch && "Expecting latch to be valid.");
- return L->isLoopExiting(Latch);
- }
-
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
LLVM_DUMP_METHOD void dump() const {
dbgs() << "\tGuardBranch: "
@@ -320,7 +308,7 @@ struct FusionCandidate {
return reportInvalidCandidate(NotSimplifiedForm);
}
- if (!isRotated()) {
+ if (!L->isRotatedForm()) {
LLVM_DEBUG(dbgs() << "Loop " << L->getName() << " is not rotated!\n");
return reportInvalidCandidate(NotRotated);
}
OpenPOWER on IntegriCloud