diff options
Diffstat (limited to 'llvm/lib/Transforms/Scalar/GuardWidening.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/GuardWidening.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/GuardWidening.cpp b/llvm/lib/Transforms/Scalar/GuardWidening.cpp index 428c8bf9153..68be46ec07b 100644 --- a/llvm/lib/Transforms/Scalar/GuardWidening.cpp +++ b/llvm/lib/Transforms/Scalar/GuardWidening.cpp @@ -57,7 +57,6 @@ #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; @@ -108,6 +107,12 @@ 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(); |