From abb992d6a3d2dc05d3f3c62a367ea8977a7dd070 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 24 Jan 2010 00:09:49 +0000 Subject: change the canonical form of "cond ? -1 : 0" to be "sext cond" instead of a select. This simplifies some instcombine code, matches the policy for zext (cond ? 1 : 0 -> zext), and allows us to generate better code for a testcase on ppc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94339 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Support/PatternMatch.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'include/llvm/Support/PatternMatch.h') diff --git a/include/llvm/Support/PatternMatch.h b/include/llvm/Support/PatternMatch.h index 23daad9239..f02bc347a1 100644 --- a/include/llvm/Support/PatternMatch.h +++ b/include/llvm/Support/PatternMatch.h @@ -423,7 +423,7 @@ m_Select(const Cond &C, const LHS &L, const RHS &R) { } /// m_SelectCst - This matches a select of two constants, e.g.: -/// m_SelectCst(m_Value(V), -1, 0) +/// m_SelectCst<-1, 0>(m_Value(V)) template inline SelectClass_match, constantint_ty > m_SelectCst(const Cond &C) { @@ -466,6 +466,20 @@ inline CastClass_match m_Trunc(const OpTy &Op) { return CastClass_match(Op); } + +/// m_SExt +template +inline CastClass_match +m_SExt(const OpTy &Op) { + return CastClass_match(Op); +} + +/// m_ZExt +template +inline CastClass_match +m_ZExt(const OpTy &Op) { + return CastClass_match(Op); +} //===----------------------------------------------------------------------===// -- cgit v1.2.3