From: Artur Pilipenko Date: Fri, 19 May 2017 13:59:34 +0000 (+0000) Subject: [LoopPredication] NFC. Add an early exit if there is no guards in the loop X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=46c4e0a4bf1fe3a25daefa40b4104f48a6269e0c;p=platform%2Fupstream%2Fllvm.git [LoopPredication] NFC. Add an early exit if there is no guards in the loop llvm-svn: 303424 --- diff --git a/llvm/lib/Transforms/Scalar/LoopPredication.cpp b/llvm/lib/Transforms/Scalar/LoopPredication.cpp index 0ce6044..e71448c 100644 --- a/llvm/lib/Transforms/Scalar/LoopPredication.cpp +++ b/llvm/lib/Transforms/Scalar/LoopPredication.cpp @@ -272,6 +272,9 @@ bool LoopPredication::runOnLoop(Loop *Loop) { if (II->getIntrinsicID() == Intrinsic::experimental_guard) Guards.push_back(II); + if (Guards.empty()) + return false; + SCEVExpander Expander(*SE, *DL, "loop-predication"); bool Changed = false;