aboutsummaryrefslogtreecommitdiff
path: root/gcc/generic-match-head.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2015-05-07 07:18:07 -0600
committerJeff Law <law@gcc.gnu.org>2015-05-07 07:18:07 -0600
commit48451e8f3c819d5f706596e32cf6d9b3cb600b5b (patch)
tree5cc975e1ee19aa16d83a69b02b66bd72b50748e7 /gcc/generic-match-head.c
parent963ba1b266651a71ad1eee55607ea9ee34c1de7c (diff)
downloadgcc-48451e8f3c819d5f706596e32cf6d9b3cb600b5b.zip
gcc-48451e8f3c819d5f706596e32cf6d9b3cb600b5b.tar.gz
gcc-48451e8f3c819d5f706596e32cf6d9b3cb600b5b.tar.bz2
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
Diffstat (limited to 'gcc/generic-match-head.c')
-rw-r--r--gcc/generic-match-head.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/generic-match-head.c b/gcc/generic-match-head.c
index daa56aa..efaa2d8 100644
--- a/gcc/generic-match-head.c
+++ b/gcc/generic-match-head.c
@@ -70,4 +70,20 @@ along with GCC; see the file COPYING3. If not see
#include "dumpfile.h"
#include "generic-match.h"
+/* Routine to determine if the types T1 and T2 are effectively
+ the same for GENERIC. */
+static inline bool
+types_match (tree t1, tree t2)
+{
+ return TYPE_MAIN_VARIANT (t1) == TYPE_MAIN_VARIANT (t2);
+}
+
+/* Return if T has a single use. For GENERIC, we assume this is
+ always true. */
+
+static inline bool
+single_use (tree t ATTRIBUTE_UNUSED)
+{
+ return true;
+}