On Fri, May 17, 2019 at 03:30:41PM +1000, Kugan Vivekanandarajah wrote: > On Fri, 17 May 2019 at 13:37, <li...@linux.ibm.com> wrote: > > + if (GET_CODE (body) == SET) > > + { > > + rtx set_val = XEXP (body, 1); > > + enum rtx_code code = GET_CODE (set_val); > > + enum rtx_class cls = GET_RTX_CLASS (code); > > + /* For now, we only consider these two RTX classes, to match what > > we > > + get in doloop_optimize, excluding operations like zero/sign > > extend. */ > > + if (cls == RTX_BIN_ARITH || cls == RTX_COMM_ARITH) > > + cost += set_src_cost (set_val, GET_MODE (set_val), speed); > Cant you have PARALLEL with SET here?
So it should use single_set and SET_SRC? Yeah I guess. For Power, we don't have many PARALLELs in freshly expanded code, so it doesn't make much difference for us. > > + if (cost > max_cost) > > + return true; > Maybe it is better to bailout early if the limit is reached instead of > doing it outside the loop? That won't be more complicated code here, so yes let's do that. Segher