[llvm] r297432 - PatternMatch; Add m_ZExtOrSExt matcher
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 9 16:47:36 PST 2017
Author: arsenm
Date: Thu Mar 9 18:47:35 2017
New Revision: 297432
URL: http://llvm.org/viewvc/llvm-project?rev=297432&view=rev
Log:
PatternMatch; Add m_ZExtOrSExt matcher
Modified:
llvm/trunk/include/llvm/IR/PatternMatch.h
Modified: llvm/trunk/include/llvm/IR/PatternMatch.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/PatternMatch.h?rev=297432&r1=297431&r2=297432&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/PatternMatch.h (original)
+++ llvm/trunk/include/llvm/IR/PatternMatch.h Thu Mar 9 18:47:35 2017
@@ -827,6 +827,13 @@ inline CastClass_match<OpTy, Instruction
return CastClass_match<OpTy, Instruction::ZExt>(Op);
}
+template <typename OpTy>
+inline match_combine_or<CastClass_match<OpTy, Instruction::ZExt>,
+ CastClass_match<OpTy, Instruction::SExt>>
+m_ZExtOrSExt(const OpTy &Op) {
+ return m_CombineOr(m_ZExt(Op), m_SExt(Op));
+}
+
/// \brief Matches UIToFP.
template <typename OpTy>
inline CastClass_match<OpTy, Instruction::UIToFP> m_UIToFP(const OpTy &Op) {
More information about the llvm-commits
mailing list