[LoopPredication] NFC. Add an early exit if there is no guards in the loop
authorArtur Pilipenko <apilipenko@azulsystems.com>
Fri, 19 May 2017 13:59:34 +0000 (13:59 +0000)
committerArtur Pilipenko <apilipenko@azulsystems.com>
Fri, 19 May 2017 13:59:34 +0000 (13:59 +0000)
llvm-svn: 303424

llvm/lib/Transforms/Scalar/LoopPredication.cpp

index 0ce6044..e71448c 100644 (file)
@@ -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;