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/Transforms/Scalar/GuardWidening.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/Transforms/Scalar/GuardWidening.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/GuardWidening.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/Scalar/GuardWidening.cpp b/llvm/lib/Transforms/Scalar/GuardWidening.cpp index 68be46ec07b..428c8bf9153 100644 --- a/llvm/lib/Transforms/Scalar/GuardWidening.cpp +++ b/llvm/lib/Transforms/Scalar/GuardWidening.cpp @@ -57,6 +57,7 @@ #include "llvm/Support/Debug.h" #include "llvm/Support/KnownBits.h" #include "llvm/Transforms/Scalar.h" +#include "llvm/Transforms/Utils/GuardUtils.h" #include "llvm/Transforms/Utils/LoopUtils.h" using namespace llvm; @@ -107,12 +108,6 @@ static void setCondition(Instruction *I, Value *NewCond) { cast<BranchInst>(I)->setCondition(NewCond); } -// Whether or not the particular instruction \p I is a guard. -static bool isGuard(const Instruction *I) { - using namespace llvm::PatternMatch; - return match(I, m_Intrinsic<Intrinsic::experimental_guard>()); -} - // Eliminates the guard instruction properly. static void eliminateGuard(Instruction *GuardInst) { GuardInst->eraseFromParent(); |