gensimplify can now generate tree simplifications as well
Daniel Berlin
dan@www.cgsoftware.com
Sat May 12 19:42:00 GMT 2001
This, of course, is completely automatic, and no syntax is required so
far.
It generates a corresponding set of gen_simplify_tree functions, and a
simplify_trees entry point.
gensimplify now has routines for writing out rtx vesrions of things, and
tree versions of things, I did this because i expect they will diverge,
possibly significantly.
I've verified it's correctness on at least 3 times as many optimiation as
was in the simplify.md i posted with the original patch, and currently
call simplify_trees as the first thing in fold, so i'm pretty confident in
it.
The main issue is mapping the rtl codes to tree operations. This is, of
course, in the general case, not possible, or at least, not easy.
A lot, however, are pretty easy.
MINUS->MINUS_EXPR,
MULT->MULT_EXPR,
PLUS->PLUS_EXPR, etc.
Currently, I have about 30 thigns in my simplify.md, spanning logical
operations to absolute values, and all the tree equivalents are handled
, generated, and perform, okay.
Obviously, i don't have any division based simplifications.
It may just be that I should make a define_simplify_tree_only, and
define_simplify_rtx_only, or something, to handle the cases where
auto-conversion isn't possible or wanted.
Ideas on what to do?
I'm willing to do whatever people think is the best solution.
I'll post a new gensimplify when i get back on tuesday.
--Dan
More information about the Gcc
mailing list