From 1f562176e9363e5b8b47bbfd6ea3b5051902a46e Mon Sep 17 00:00:00 2001 From: Michael Zolotukhin Date: Tue, 9 Jan 2018 23:54:35 +0000 Subject: [LoopRotate] Detect loops with indirect branches better (we're giving up on them). llvm-svn: 322137 --- llvm/lib/Transforms/Scalar/LoopRotation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib') diff --git a/llvm/lib/Transforms/Scalar/LoopRotation.cpp b/llvm/lib/Transforms/Scalar/LoopRotation.cpp index a91f53ba663..0f35fccbe66 100644 --- a/llvm/lib/Transforms/Scalar/LoopRotation.cpp +++ b/llvm/lib/Transforms/Scalar/LoopRotation.cpp @@ -268,7 +268,7 @@ bool LoopRotate::rotateLoop(Loop *L, bool SimplifiedLatch) { // If the loop could not be converted to canonical form, it must have an // indirectbr in it, just give up. - if (!OrigPreheader) + if (!OrigPreheader || !L->hasDedicatedExits()) return false; // Anything ScalarEvolution may know about this loop or the PHI nodes -- cgit v1.2.3