gimple SSA combine. Provide a simple interface for simplifying and reducing gimple expressions while doing a combine type of operations. An example is -(-x) to x. These interface is to be used while doing VRP and VN type of operations.
Right now the interface for this new functionality is: tree ssa_combine (gimple stmt)
- Take the statement STMT and try to simplify it, Right now it returns a complex tree but later it might take an extra argument to say what to return, constant, simple or complex.
void gimple_combine_set_nonzerobits (nonzerobits_t)
- Sets up the nonzerobits hook which will be used during the simplifying. Right now VRP is the only one which sets this hook, though CCP could also use the hook
tree gimple_combine_binary_(location_t, enum tree_code, tree, tree, tree); tree gimple_combine_unary (location_t, enum tree_code, tree, tree); tree gimple_combine_ternary (location_t, enum tree_code, tree, tree, tree, tree);
- They act just like fold_binary/fold_unary/fold_ternary but use the hooks and IR to do the simplifying.
bool replace_rhs_after_ssa_combine (gimple_stmt_iterator *, tree)
- Replace the right hand side of the statement at the iterator with the argument, can create extra statements. Return true if the replacement happened.
Future planed interface: void gimple_combine_set_valueization (valueization_t)
- When we find a SSA_NAME, try to valueize it before doing a simplifying. This will allow things like VN and CCP to use the combing functions rather than gimple_fold.