- in[i] = new_r_Phi(irg, block, n_rets, &retvals[j], get_irn_mode(retvals[j]));
+
+ /* Beware: normally the Phi constructor automatically replaces a Phi(a,...a) into a
+ but NOT, if a is Unknown. Here, we known that this case can be optimize also,
+ so do it here */
+ first = retvals[j + 0];
+ for (k = 1; k < n_rets; ++k) {
+ if (retvals[j + k] != first) {
+ first = NULL;
+ break;
+ }
+ }
+ if (first)
+ in[i] = first;
+ else
+ in[i] = new_r_Phi(irg, block, n_rets, &retvals[j], get_irn_mode(retvals[j]));