[LoopPredication] NFC. Add an early exit if there is no guards in the loop

llvm-svn: 303424
This commit is contained in:
Artur Pilipenko 2017-05-19 13:59:34 +00:00
parent 9321e8fcec
commit 46c4e0a4bf
1 changed files with 3 additions and 0 deletions

View 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;