aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2015-07-01 07:36:25 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2015-07-01 07:36:25 +0000
commit88a2d13f6c3565b1bcfdb440ec0988159818f339 (patch)
treee8fc121f69401342347e0171f7cab34f1ff75e7e
parente8cfe4c5a5490317edaba67819f1a4253e464e23 (diff)
downloadgcc-88a2d13f6c3565b1bcfdb440ec0988159818f339.zip
gcc-88a2d13f6c3565b1bcfdb440ec0988159818f339.tar.gz
gcc-88a2d13f6c3565b1bcfdb440ec0988159818f339.tar.bz2
genmatch.c (expr::gen_transform): Shortcut re-simplifying of converts to avoid uninteresting noise from the...
2015-07-01 Richard Biener <rguenther@suse.de> * genmatch.c (expr::gen_transform): Shortcut re-simplifying of converts to avoid uninteresting noise from the conversion simplifying patterns. From-SVN: r225223
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/genmatch.c13
2 files changed, 19 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index bedeee1..af2c5d8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2015-07-01 Richard Biener <rguenther@suse.de>
+
+ * genmatch.c (expr::gen_transform): Shortcut re-simplifying
+ of converts to avoid uninteresting noise from the conversion
+ simplifying patterns.
+
2015-06-30 Sandra Loosemore <sandra@codesourcery.com>
* config/c6x/c6x.c (try_rename_operands): Do not depend on
diff --git a/gcc/genmatch.c b/gcc/genmatch.c
index 2bd61d3..6f8cea9 100644
--- a/gcc/genmatch.c
+++ b/gcc/genmatch.c
@@ -1740,6 +1740,10 @@ expr::gen_transform (FILE *f, const char *dest, bool gimple, int depth,
if (gimple)
{
+ if (*operation == CONVERT_EXPR)
+ fprintf (f, " if (%s != TREE_TYPE (ops%d[0])\n"
+ " && !useless_type_conversion_p (%s, TREE_TYPE (ops%d[0])))\n"
+ " {\n", type, depth, type, depth);
/* ??? Building a stmt can fail for various reasons here, seq being
NULL or the stmt referencing SSA names occuring in abnormal PHIs.
So if we fail here we should continue matching other patterns. */
@@ -1752,9 +1756,15 @@ expr::gen_transform (FILE *f, const char *dest, bool gimple, int depth,
ops.length (), type);
fprintf (f, " res = maybe_push_res_to_seq (tem_code, %s, tem_ops, seq);\n"
" if (!res) return false;\n", type);
+ if (*operation == CONVERT_EXPR)
+ fprintf (f, " }\n"
+ " else\n"
+ " res = ops%d[0];\n", depth);
}
else
{
+ if (*operation == CONVERT_EXPR)
+ fprintf (f, " if (TREE_TYPE (ops%d[0]) != %s)\n", depth, type);
if (operation->kind == id_base::CODE)
fprintf (f, " res = fold_build%d_loc (loc, %s, %s",
ops.length(), opr, type);
@@ -1764,6 +1774,9 @@ expr::gen_transform (FILE *f, const char *dest, bool gimple, int depth,
for (unsigned i = 0; i < ops.length (); ++i)
fprintf (f, ", ops%d[%u]", depth, i);
fprintf (f, ");\n");
+ if (*operation == CONVERT_EXPR)
+ fprintf (f, " else\n"
+ " res = ops%d[0];\n", depth);
}
fprintf (f, "%s = res;\n", dest);
fprintf (f, "}\n");