summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/GuardWidening.cpp
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2018-08-29 12:21:32 +0000
committerHans Wennborg <hans@hanshq.net>2018-08-29 12:21:32 +0000
commit2c390c54f64c6303aa4f7151cda5c466ae3ccc23 (patch)
treefa9fa288532951db4818a6c0d44a23334a8d624a /llvm/lib/Transforms/Scalar/GuardWidening.cpp
parentc03b9b8854399aa5234fdee1eb3838ce4adccbaf (diff)
downloadbcm5719-llvm-2c390c54f64c6303aa4f7151cda5c466ae3ccc23.tar.gz
bcm5719-llvm-2c390c54f64c6303aa4f7151cda5c466ae3ccc23.zip
Revert r340921 "[NFC] Unify guards detection"
This broke the build, see e.g. http://lab.llvm.org:8011/builders/clang-cmake-armv8-lnt/builds/4626/ http://lab.llvm.org:8011/builders/clang-ppc64be-linux-lnt/builds/18647/ http://lab.llvm.org:8011/builders/clang-cmake-x86_64-avx2-linux/builds/5856/ http://lab.llvm.org:8011/builders/lld-x86_64-freebsd/builds/22800/ > 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: 340923
Diffstat (limited to 'llvm/lib/Transforms/Scalar/GuardWidening.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/GuardWidening.cpp7
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();
OpenPOWER on IntegriCloud