summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-11-16 04:33:10 +0000
committerChris Lattner <sabre@nondot.org>2008-11-16 04:33:10 +0000
commit2e692e2a31a0155e272ec26e86010d52567db483 (patch)
tree5820c96cb5781757b9c376888e3e248f7b329314
parent569d78cbb5a1589e6bdcdafc1f7faddf33bb3434 (diff)
downloadbcm5719-llvm-2e692e2a31a0155e272ec26e86010d52567db483.tar.gz
bcm5719-llvm-2e692e2a31a0155e272ec26e86010d52567db483.zip
add a new template for matching a select between two constants.
llvm-svn: 59391
-rw-r--r--llvm/include/llvm/Support/PatternMatch.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/include/llvm/Support/PatternMatch.h b/llvm/include/llvm/Support/PatternMatch.h
index 2408103cb94..f5356a6edd2 100644
--- a/llvm/include/llvm/Support/PatternMatch.h
+++ b/llvm/include/llvm/Support/PatternMatch.h
@@ -367,6 +367,17 @@ m_Select(const Cond &C, const LHS &L, const RHS &R) {
return SelectClass_match<Cond, LHS, RHS>(C, L, R);
}
+/// m_SelectCst - This matches a select of two constants, e.g.:
+/// m_SelectCst(m_Value(V), -1, 0)
+template<typename Cond>
+inline SelectClass_match<Cond, constantint_ty, constantint_ty>
+m_SelectCst(const Cond &C, int64_t L, int64_t R) {
+ return SelectClass_match<Cond, constantint_ty,
+ constantint_ty>(C, m_ConstantInt(L),
+ m_ConstantInt(R));
+}
+
+
//===----------------------------------------------------------------------===//
// Matchers for CastInst classes
//
OpenPOWER on IntegriCloud