- } else if (is_binop(succ)) {
- /* We have reached a BinOp and we must increase the
- weight with the binop_weight. If the other operand of the
- BinOp is a constant we increase the weight with const_binop_weight
- and call the function recursive.
- */
- if (get_binop_left(succ) == arg)
- op = get_binop_right(succ);
- else
- op = get_binop_left(succ);
-
- if (is_irn_constlike(op)) {
+ break;
+ case iro_Id:
+ /* when looking backward we might find Id nodes */
+ weight += calc_method_param_weight(succ);
+ break;
+ case iro_Tuple:
+ /* unoptimized tuple */
+ for (j = get_Tuple_n_preds(succ) - 1; j >= 0; --j) {
+ ir_node *pred = get_Tuple_pred(succ, j);
+ if (pred == arg) {
+ /* look for Proj(j) */
+ for (k = get_irn_n_outs(succ) - 1; k >= 0; --k) {
+ ir_node *succ_succ = get_irn_out(succ, k);
+ if (is_Proj(succ_succ)) {
+ if (get_Proj_proj(succ_succ) == j) {
+ /* found */
+ weight += calc_method_param_weight(succ_succ);
+ }
+ } else {
+ /* this should NOT happen */
+ }
+ }
+ }
+ }
+ break;
+ default:
+ if (is_binop(succ)) {
+ /* We have reached a BinOp and we must increase the
+ weight with the binop_weight. If the other operand of the
+ BinOp is a constant we increase the weight with const_binop_weight
+ and call the function recursive.
+ */
+ if (get_binop_left(succ) == arg)
+ op = get_binop_right(succ);
+ else
+ op = get_binop_left(succ);
+
+ if (is_irn_constlike(op)) {
+ weight += const_binop_weight;
+ weight += calc_method_param_weight(succ);
+ } else
+ weight += binop_weight;
+ } else if (is_unop(succ)) {
+ /* We have reached a binop and we must increase the
+ weight with the const_binop_weight and call the function recursive.*/