aboutsummaryrefslogtreecommitdiff
path: root/gcc/generic-match-head.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2015-05-04 11:21:56 -0600
committerJeff Law <law@gcc.gnu.org>2015-05-04 11:21:56 -0600
commit383be4a8c1518edfc2b74d31027e21d43c101ff0 (patch)
tree5fec3524fe94c084995893d0a77504b8dfcb5c01 /gcc/generic-match-head.c
parente2bbbfbcbd27cc6ef3f68d0d619f54d29ca0aa05 (diff)
downloadgcc-383be4a8c1518edfc2b74d31027e21d43c101ff0.zip
gcc-383be4a8c1518edfc2b74d31027e21d43c101ff0.tar.gz
gcc-383be4a8c1518edfc2b74d31027e21d43c101ff0.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: r222771
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..303b237 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. */
+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. */
+
+inline bool
+single_use (tree t)
+{
+ return true;
+}