diff options
author | Kit Barton <kbarton@ca.ibm.com> | 2019-12-03 14:20:08 -0500 |
---|---|---|
committer | Kit Barton <kbarton@ca.ibm.com> | 2019-12-11 09:43:10 -0500 |
commit | 942c9946cc2fba6acd3805cfeaca90007f532f1f (patch) | |
tree | a39f477b825274780c4c9368df1a9d8f00a3f296 /llvm/lib/Analysis | |
parent | df494f7512b0ecebdf3d7be97695a1b6278c0336 (diff) | |
download | bcm5719-llvm-942c9946cc2fba6acd3805cfeaca90007f532f1f.tar.gz bcm5719-llvm-942c9946cc2fba6acd3805cfeaca90007f532f1f.zip |
[Loop] Add isRotated method to Loop class.
Summary:
This patch adds a method to determine if a loop is in rotated form (the latch is
an exiting block). It also modifies the getLoopGuardBranch method to use this
new method. This method can also be used in Loopfusion. Once this patch lands I
will make the corresponding changes there.
Reviewers: jdoerfert, Meinersbur, dmgreen, etiotto, Whitney, fhahn, hfinkel
Reviewed By: Meinersbur
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D65958
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r-- | llvm/lib/Analysis/LoopInfo.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/LoopInfo.cpp b/llvm/lib/Analysis/LoopInfo.cpp index 3e3303cbb02..e67e1ae0875 100644 --- a/llvm/lib/Analysis/LoopInfo.cpp +++ b/llvm/lib/Analysis/LoopInfo.cpp @@ -371,7 +371,7 @@ BranchInst *Loop::getLoopGuardBranch() const { "Expecting a loop with valid preheader and latch"); // Loop should be in rotate form. - if (!isLoopExiting(Latch)) + if (!isRotated()) return nullptr; // Disallow loops with more than one unique exit block, as we do not verify |