summaryrefslogtreecommitdiff
path: root/gcc/generic-match-head.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2015-05-04 17:21:56 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2015-05-04 17:21:56 +0000
commitc8c9ffdbecc7e19880c05674ccd85826e7d464de (patch)
tree5fec3524fe94c084995893d0a77504b8dfcb5c01 /gcc/generic-match-head.c
parent62b41575ba649075b90686b4abc4df23ff64f00f (diff)
downloadgcc-c8c9ffdbecc7e19880c05674ccd85826e7d464de.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222771 138bc75d-0d04-0410-961f-82ee72b054a4
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 daa56aa370e..303b23759a1 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;
+}