This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RFC: Gimple combine/folding interface
- From: Andrew Pinski <pinskia at gmail dot com>
- To: GCC Mailing List <gcc at gcc dot gnu dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 19 Jul 2013 17:09:40 -0700
- Subject: RFC: Gimple combine/folding interface
I was creating a new gimple/folding interface and wanted some opinions
on the interface.
typedef double_int (*nonzerobits_t)(tree var);
typedef tree (*valueizer_t)(tree var);
class gimple_combine
{
public:
gimple_combine(nonzerobits_t a, valueizer_t b) : nonzerobitsf(a),
valueizerv(b), allow_full_reassiocation(false) {}
gimple_combine() : nonzerobitsf(NULL), valueizerv(NULL),
allow_full_reassiocation(false) {}
gimple_combine(bool reas) : nonzerobitsf(NULL), valueizerv(NULL),
allow_full_reassiocation(reas) {}
tree build2 (location_t, enum tree_code, tree, tree, tree);
tree build1 (location_t, enum tree_code, tree, tree);
tree build3 (location_t, enum tree_code, tree, tree, tree, tree);
tree combine (gimple);
private:
nonzerobits_t nonzerobitsf;
valueizer_t valueizerv;
bool allow_full_reassiocation;
tree binary (location_t, enum tree_code, tree, tree, tree);
tree unary (location_t, enum tree_code, tree, tree);
tree ternary (location_t, enum tree_code, tree, tree, tree, tree);
};
bool replace_rhs_after_ssa_combine (gimple_stmt_iterator *, tree);
This is what I have so far and wonder if there is anything else I
should include.
This will be used to replace the folding code in fold-const.c and gimple-fold.c.
Thanks,
Andrew Pinski