https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108764

Sinan <sinan.lin at linux dot alibaba.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |riscv

--- Comment #1 from Sinan <sinan.lin at linux dot alibaba.com> ---
In the given test case, rv64gc generates better code than rv64gc_zba since asm
is less and simpler. In this case, we have an instruction chain like,
  ashldi3: reg80=reg79 << 3;
  adddi3:  reg81=reg80+reg78;
  movdi:   reg82=reg80;
where ashldi3 has two uses, then combining ashldi3+adddi3 isn't really free.

I think one solution is to change the cost model of such complex instructions
to the sum of the cost for each part. E.g. 
cost for shNadd = COSTS_N_INSNS (SINGLE_SHIFT_COST) + COSTS_N_INSNS (1) # cost
of addition

Reply via email to