[PATCH] D30105: PatternMatch; Add m_AExt to match zext or sext

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 17 10:53:05 PST 2017


arsenm created this revision.
Herald added a subscriber: wdng.

https://reviews.llvm.org/D30105

Files:
  include/llvm/IR/PatternMatch.h


Index: include/llvm/IR/PatternMatch.h
===================================================================
--- include/llvm/IR/PatternMatch.h
+++ include/llvm/IR/PatternMatch.h
@@ -814,6 +814,12 @@
   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_AExt(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) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30105.88924.patch
Type: text/x-patch
Size: 627 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170217/11ace2f8/attachment.bin>


More information about the llvm-commits mailing list