[llvm] r303424 - [LoopPredication] NFC. Add an early exit if there is no guards in the loop
Artur Pilipenko via llvm-commits
llvm-commits at lists.llvm.org
Fri May 19 06:59:34 PDT 2017
Author: apilipenko
Date: Fri May 19 08:59:34 2017
New Revision: 303424
URL: http://llvm.org/viewvc/llvm-project?rev=303424&view=rev
Log:
[LoopPredication] NFC. Add an early exit if there is no guards in the loop
Modified:
llvm/trunk/lib/Transforms/Scalar/LoopPredication.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/LoopPredication.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopPredication.cpp?rev=303424&r1=303423&r2=303424&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopPredication.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopPredication.cpp Fri May 19 08:59:34 2017
@@ -272,6 +272,9 @@ bool LoopPredication::runOnLoop(Loop *Lo
if (II->getIntrinsicID() == Intrinsic::experimental_guard)
Guards.push_back(II);
+ if (Guards.empty())
+ return false;
+
SCEVExpander Expander(*SE, *DL, "loop-predication");
bool Changed = false;
More information about the llvm-commits
mailing list