diff options
author | Max Kazantsev <max.kazantsev@azul.com> | 2018-08-29 11:37:34 +0000 |
---|---|---|
committer | Max Kazantsev <max.kazantsev@azul.com> | 2018-08-29 11:37:34 +0000 |
commit | 1dafaa87d9c3b25f53bd18cab18725dd1d76023e (patch) | |
tree | 1915f21f63fb0a4f3a8b9b76335a62324dead908 /llvm/lib/Analysis/ValueTracking.cpp | |
parent | f8f00e5065f728be233a7c644245c2611a008968 (diff) | |
download | bcm5719-llvm-1dafaa87d9c3b25f53bd18cab18725dd1d76023e.tar.gz bcm5719-llvm-1dafaa87d9c3b25f53bd18cab18725dd1d76023e.zip |
[NFC] Unify guards detection
We have multiple places in code where we try to identify whether or not
some instruction is a guard. This patch factors out this logic into a separate
utility function which works uniformly in all places.
Differential Revision: https://reviews.llvm.org/D51152
Reviewed By: fedor.sergeev
llvm-svn: 340921
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
-rw-r--r-- | llvm/lib/Analysis/ValueTracking.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp index a207a5064db..527673f47d8 100644 --- a/llvm/lib/Analysis/ValueTracking.cpp +++ b/llvm/lib/Analysis/ValueTracking.cpp @@ -66,6 +66,7 @@ #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/KnownBits.h" #include "llvm/Support/MathExtras.h" +#include "llvm/Transforms/Utils/GuardUtils.h" #include <algorithm> #include <array> #include <cassert> @@ -1902,8 +1903,7 @@ static bool isKnownNonNullFromDominatingCondition(const Value *V, BasicBlockEdge Edge(BI->getParent(), NonNullSuccessor); if (Edge.isSingleEdge() && DT->dominates(Edge, CtxI->getParent())) return true; - } else if (Pred == ICmpInst::ICMP_NE && - match(Curr, m_Intrinsic<Intrinsic::experimental_guard>()) && + } else if (Pred == ICmpInst::ICMP_NE && isGuard(Curr) && DT->dominates(cast<Instruction>(Curr), CtxI)) { return true; } |