Commit c8136c36 by Richard Biener Committed by Richard Biener

genmatch.c (dt_node::gen_kids_1): Use gassign and gcall in generated code.

2015-08-04  Richard Biener  <rguenther@suse.de>

	* genmatch.c (dt_node::gen_kids_1): Use gassign and gcall in
	generated code.
	(dt_operand::gen_gimple_expr): Adjust.

From-SVN: r226577
parent 59c20dc7
2015-08-04 Richard Biener <rguenther@suse.de> 2015-08-04 Richard Biener <rguenther@suse.de>
* genmatch.c (dt_node::gen_kids_1): Use gassign and gcall in
generated code.
(dt_operand::gen_gimple_expr): Adjust.
2015-08-04 Richard Biener <rguenther@suse.de>
* gimple-fold.c (gimple_fold_stmt_to_constant_1): Canonicalize * gimple-fold.c (gimple_fold_stmt_to_constant_1): Canonicalize
bool compares on RHS. bool compares on RHS.
* match.pd: Add X ==/!= !X is false/true pattern. * match.pd: Add X ==/!= !X is false/true pattern.
......
...@@ -2396,7 +2396,7 @@ dt_operand::gen_gimple_expr (FILE *f, int indent) ...@@ -2396,7 +2396,7 @@ dt_operand::gen_gimple_expr (FILE *f, int indent)
match this. The only sensible operand types are match this. The only sensible operand types are
SSA names and invariants. */ SSA names and invariants. */
fprintf_indent (f, indent, fprintf_indent (f, indent,
"tree %s = TREE_OPERAND (gimple_assign_rhs1 (def_stmt), %i);\n", "tree %s = TREE_OPERAND (gimple_assign_rhs1 (def), %i);\n",
child_opname, i); child_opname, i);
fprintf_indent (f, indent, fprintf_indent (f, indent,
"if ((TREE_CODE (%s) == SSA_NAME\n", "if ((TREE_CODE (%s) == SSA_NAME\n",
...@@ -2414,12 +2414,12 @@ dt_operand::gen_gimple_expr (FILE *f, int indent) ...@@ -2414,12 +2414,12 @@ dt_operand::gen_gimple_expr (FILE *f, int indent)
} }
else else
fprintf_indent (f, indent, fprintf_indent (f, indent,
"tree %s = gimple_assign_rhs%u (def_stmt);\n", "tree %s = gimple_assign_rhs%u (def);\n",
child_opname, i + 1); child_opname, i + 1);
} }
else else
fprintf_indent (f, indent, fprintf_indent (f, indent,
"tree %s = gimple_call_arg (def_stmt, %u);\n", "tree %s = gimple_call_arg (def, %u);\n",
child_opname, i); child_opname, i);
fprintf_indent (f, indent, fprintf_indent (f, indent,
"if ((%s = do_valueize (valueize, %s)))\n", "if ((%s = do_valueize (valueize, %s)))\n",
...@@ -2600,9 +2600,9 @@ dt_node::gen_kids_1 (FILE *f, int indent, bool gimple, ...@@ -2600,9 +2600,9 @@ dt_node::gen_kids_1 (FILE *f, int indent, bool gimple,
if (exprs_len) if (exprs_len)
{ {
fprintf_indent (f, indent, fprintf_indent (f, indent,
"if (is_gimple_assign (def_stmt))\n"); "if (gassign *def = dyn_cast <gassign *> (def_stmt))\n");
fprintf_indent (f, indent, fprintf_indent (f, indent,
" switch (gimple_assign_rhs_code (def_stmt))\n"); " switch (gimple_assign_rhs_code (def))\n");
indent += 4; indent += 4;
fprintf_indent (f, indent, "{\n"); fprintf_indent (f, indent, "{\n");
for (unsigned i = 0; i < exprs_len; ++i) for (unsigned i = 0; i < exprs_len; ++i)
...@@ -2625,16 +2625,15 @@ dt_node::gen_kids_1 (FILE *f, int indent, bool gimple, ...@@ -2625,16 +2625,15 @@ dt_node::gen_kids_1 (FILE *f, int indent, bool gimple,
if (fns_len) if (fns_len)
{ {
if (exprs_len) fprintf_indent (f, indent,
fprintf_indent (f, indent, "else "); "%sif (gimple_call_builtin_p (def_stmt, BUILT_IN_NORMAL))\n",
else exprs_len ? "else " : "");
fprintf_indent (f, indent, " ");
fprintf (f, "if (gimple_call_builtin_p (def_stmt, BUILT_IN_NORMAL))\n");
fprintf_indent (f, indent, fprintf_indent (f, indent,
" {\n"); " {\n");
fprintf_indent (f, indent, fprintf_indent (f, indent,
" tree fndecl = gimple_call_fndecl (def_stmt);\n"); " gcall *def = as_a <gcall *> (def_stmt);\n");
fprintf_indent (f, indent,
" tree fndecl = gimple_call_fndecl (def);\n");
fprintf_indent (f, indent, fprintf_indent (f, indent,
" switch (DECL_FUNCTION_CODE (fndecl))\n"); " switch (DECL_FUNCTION_CODE (fndecl))\n");
fprintf_indent (f, indent, fprintf_indent (f, indent,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment