Hi, Function get_address_cost in ivopt computes multiplied address cost with below code:
First: rat = 1; for (i = 2; i <= MAX_RATIO; i++) if (multiplier_allowed_in_address_p (i, mem_mode, as)) { rat = i; break; } Then: if (rat_p) addr = gen_rtx_fmt_ee (MULT, address_mode, addr, gen_int_mode (rat, address_mode)); What's the purpose of first iteration? It just finds the first allowed ratio in address, causing the generated ADDR always has the minimal allowed ratio. Is it right? For target doesn't support multiplied address, the generated ADDR is: (MULT reg, 1). The cost generally is equal to address with pure register. What's the meaning of this cost? Thanks very much. -- Best Regards.