[llvm] r350064 - [NFC] Use utility function for guards detection
Max Kazantsev via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 26 00:22:25 PST 2018
Author: mkazantsev
Date: Wed Dec 26 00:22:25 2018
New Revision: 350064
URL: http://llvm.org/viewvc/llvm-project?rev=350064&view=rev
Log:
[NFC] Use utility function for guards detection
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=350064&r1=350063&r2=350064&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopPredication.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopPredication.cpp Wed Dec 26 00:22:25 2018
@@ -180,6 +180,7 @@
#include "llvm/Transforms/Scalar/LoopPredication.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/BranchProbabilityInfo.h"
+#include "llvm/Analysis/GuardUtils.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/LoopPass.h"
#include "llvm/Analysis/ScalarEvolution.h"
@@ -820,9 +821,8 @@ bool LoopPredication::runOnLoop(Loop *Lo
SmallVector<IntrinsicInst *, 4> Guards;
for (const auto BB : L->blocks())
for (auto &I : *BB)
- if (auto *II = dyn_cast<IntrinsicInst>(&I))
- if (II->getIntrinsicID() == Intrinsic::experimental_guard)
- Guards.push_back(II);
+ if (isGuard(&I))
+ Guards.push_back(cast<IntrinsicInst>(&I));
if (Guards.empty())
return false;
More information about the llvm-commits
mailing list