On 2020-08-26 5:06 a.m., Richard Sandiford wrote:
Alex Coplan <alex.cop...@arm.com> writes: Minor nit, should be formatted as: static rtx canonicalize_reload_addr (rtx addr)
Sorry for missing this. Alex, it should be fixed anyway.
I don't think we should we restrict this to (plus (mult X Y) Z), since addresses can be more complicated than that. One way to search for all MULTs is: subrtx_iterator::array_type array; FOR_EACH_SUBRTX (iter, array, x, NONCONST) { rtx x = *iter; if (GET_CODE (x) == MULT && CONST_INT_P (XEXP (x, 1))) ... } (Needs rtl-iter.h)
I am agree it would be nice to process a general case. Alex, you can do this as a separate patch if you want.
Richard, thank you for looking at this patch too.