aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Support/PatternMatch.h
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-02-02 02:16:23 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-02-02 02:16:23 +0000
commit832254e1c2387c0cbeb0a820b8315fbe85cb003a (patch)
treed3d0c15237b69dfda4ea152775417f2cc67b369b /include/llvm/Support/PatternMatch.h
parent9a2ef9509e76869c3d658fb3e321d9b9e9d479d9 (diff)
Changes to support making the shift instructions be true BinaryOperators.
This feature is needed in order to support shifts of more than 255 bits on large integer types. This changes the syntax for llvm assembly to make shl, ashr and lshr instructions look like a binary operator: shl i32 %X, 1 instead of shl i32 %X, i8 1 Additionally, this should help a few passes perform additional optimizations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33776 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/PatternMatch.h')
-rw-r--r--include/llvm/Support/PatternMatch.h32
1 files changed, 16 insertions, 16 deletions
diff --git a/include/llvm/Support/PatternMatch.h b/include/llvm/Support/PatternMatch.h
index 97e9b5f961..3cf037fa05 100644
--- a/include/llvm/Support/PatternMatch.h
+++ b/include/llvm/Support/PatternMatch.h
@@ -166,27 +166,27 @@ inline BinaryOp_match<LHS, RHS, Instruction::Xor> m_Xor(const LHS &L,
}
template<typename LHS, typename RHS>
-inline BinaryOp_match<LHS, RHS, Instruction::Shl,
- ShiftInst> m_Shl(const LHS &L, const RHS &R) {
- return BinaryOp_match<LHS, RHS, Instruction::Shl, ShiftInst>(L, R);
+inline BinaryOp_match<LHS, RHS, Instruction::Shl> m_Shl(const LHS &L,
+ const RHS &R) {
+ return BinaryOp_match<LHS, RHS, Instruction::Shl>(L, R);
}
template<typename LHS, typename RHS>
-inline BinaryOp_match<LHS, RHS, Instruction::LShr,
- ShiftInst> m_LShr(const LHS &L, const RHS &R) {
- return BinaryOp_match<LHS, RHS, Instruction::LShr, ShiftInst>(L, R);
+inline BinaryOp_match<LHS, RHS, Instruction::LShr> m_LShr(const LHS &L,
+ const RHS &R) {
+ return BinaryOp_match<LHS, RHS, Instruction::LShr>(L, R);
}
template<typename LHS, typename RHS>
-inline BinaryOp_match<LHS, RHS, Instruction::AShr,
- ShiftInst> m_AShr(const LHS &L, const RHS &R) {
- return BinaryOp_match<LHS, RHS, Instruction::AShr, ShiftInst>(L, R);
+inline BinaryOp_match<LHS, RHS, Instruction::AShr> m_AShr(const LHS &L,
+ const RHS &R) {
+ return BinaryOp_match<LHS, RHS, Instruction::AShr>(L, R);
}
//===----------------------------------------------------------------------===//
// Matchers for either AShr or LShr .. for convenience
//
-template<typename LHS_t, typename RHS_t, typename ConcreteTy = ShiftInst>
+template<typename LHS_t, typename RHS_t, typename ConcreteTy = BinaryOperator>
struct Shr_match {
LHS_t L;
RHS_t R;
@@ -248,18 +248,18 @@ struct BinaryOpClass_match {
};
template<typename LHS, typename RHS>
-inline BinaryOpClass_match<LHS, RHS, ShiftInst, Instruction::OtherOps>
-m_Shift(Instruction::OtherOps &Op, const LHS &L, const RHS &R) {
+inline BinaryOpClass_match<LHS, RHS, BinaryOperator, Instruction::BinaryOps>
+m_Shift(Instruction::BinaryOps &Op, const LHS &L, const RHS &R) {
return BinaryOpClass_match<LHS, RHS,
- ShiftInst, Instruction::OtherOps>(Op, L, R);
+ BinaryOperator, Instruction::BinaryOps>(Op, L, R);
}
template<typename LHS, typename RHS>
-inline BinaryOpClass_match<LHS, RHS, ShiftInst, Instruction::OtherOps>
+inline BinaryOpClass_match<LHS, RHS, BinaryOperator, Instruction::BinaryOps>
m_Shift(const LHS &L, const RHS &R) {
- Instruction::OtherOps Op;
+ Instruction::BinaryOps Op;
return BinaryOpClass_match<LHS, RHS,
- ShiftInst, Instruction::OtherOps>(Op, L, R);
+ BinaryOperator, Instruction::BinaryOps>(Op, L, R);
}
//===----------------------------------------------------------------------===//