Commit 28fabd43 by Richard Biener Committed by Richard Biener

genmatch.c (enum tree_code): Remove CONVERT{0,1,2} and VIEW_CONVERT{0,1,2}.

2019-12-06  Richard Biener  <rguenther@suse.de>

	* genmatch.c (enum tree_code): Remove CONVERT{0,1,2} and
	VIEW_CONVERT{0,1,2}.
	(expr::opt_grp): Add and initialize.
	(lower_opt_convert): Rename to ...
	(lower_opt): ... and work on opt_grp, simply switching operations
	from being optional to being present or not.
	(has_opt_convert): Rename to ...
	(has_opt): ... and adjust.
	(parser::parse_operation): Return the optional opt_grp,
	remove special-casing of conditional operations and more generally
	parse [digit]'?'.
	(parser::parse_expr): Stick on the parsed opt_grp and perform
	rough verification.
	(parser::parse_for): Remove now unnecessary code.
	(main): Likewise.
	* doc/match-and-simplify.texi: Mention ? now works on all
	unary operations and also match predicates.

From-SVN: r279037
parent f7f6be76
2019-12-06 Richard Biener <rguenther@suse.de>
* genmatch.c (enum tree_code): Remove CONVERT{0,1,2} and
VIEW_CONVERT{0,1,2}.
(expr::opt_grp): Add and initialize.
(lower_opt_convert): Rename to ...
(lower_opt): ... and work on opt_grp, simply switching operations
from being optional to being present or not.
(has_opt_convert): Rename to ...
(has_opt): ... and adjust.
(parser::parse_operation): Return the optional opt_grp,
remove special-casing of conditional operations and more generally
parse [digit]'?'.
(parser::parse_expr): Stick on the parsed opt_grp and perform
rough verification.
(parser::parse_for): Remove now unnecessary code.
(main): Likewise.
* doc/match-and-simplify.texi: Mention ? now works on all
unary operations and also match predicates.
2019-12-06 Jan Hubicka <hubicka@ucw.cz> 2019-12-06 Jan Hubicka <hubicka@ucw.cz>
* cgraphclones.c (cgraph_node::create_clone): Only localize toplevel * cgraphclones.c (cgraph_node::create_clone): Only localize toplevel
...@@ -380,6 +380,9 @@ patterns only. If you want to match all four combinations you ...@@ -380,6 +380,9 @@ patterns only. If you want to match all four combinations you
have access to two additional conditional converts as in have access to two additional conditional converts as in
@code{(eq (convert1@? @@1) (convert2@? @@2))}. @code{(eq (convert1@? @@1) (convert2@? @@2))}.
The support for @code{?} marking extends to all unary operations
including predicates you declare yourself with @code{match}.
Predicates available from the GCC middle-end need to be made Predicates available from the GCC middle-end need to be made
available explicitely via @code{define_predicates}: available explicitely via @code{define_predicates}:
......
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