From 48451e8f3c819d5f706596e32cf6d9b3cb600b5b Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Thu, 7 May 2015 07:18:07 -0600 Subject: match.pd (bit_and (plus/minus (convert @0) (convert @1) mask): New simplifier to narrow arithmetic. * match.pd (bit_and (plus/minus (convert @0) (convert @1) mask): New simplifier to narrow arithmetic. * generic-match-head.c: (types_match, single_use): New functions. * gimple-match-head.c: (types_match, single_use): New functions. * gcc.dg/tree-ssa/shorten-1.c: New test. From-SVN: r222877 --- gcc/gimple-match-head.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'gcc/gimple-match-head.c') diff --git a/gcc/gimple-match-head.c b/gcc/gimple-match-head.c index c7b2f957bac..7b9348b53ec 100644 --- a/gcc/gimple-match-head.c +++ b/gcc/gimple-match-head.c @@ -861,3 +861,21 @@ do_valueize (tree (*valueize)(tree), tree op) return op; } +/* Routine to determine if the types T1 and T2 are effectively + the same for GIMPLE. */ + +static inline bool +types_match (tree t1, tree t2) +{ + return types_compatible_p (t1, t2); +} + +/* Return if T has a single use. For GIMPLE, we also allow any + non-SSA_NAME (ie constants) and zero uses to cope with uses + that aren't linked up yet. */ + +static inline bool +single_use (tree t) +{ + return TREE_CODE (t) != SSA_NAME || has_zero_uses (t) || has_single_use (t); +} -- cgit v1.2.3