From 942c9946cc2fba6acd3805cfeaca90007f532f1f Mon Sep 17 00:00:00 2001 From: Kit Barton Date: Tue, 3 Dec 2019 14:20:08 -0500 Subject: [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 --- llvm/lib/Analysis/LoopInfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Analysis') 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 -- cgit v1.2.3