May be it is COST issue of RVV instruction ? /* TODO: We set RVV instruction cost as 1 by default. Cost Model need to be well analyzed and supported in the future. */ if (riscv_v_ext_mode_p (mode)) { *total = COSTS_N_INSNS (1); return true; }
Since all RVV instructions are considered as very cheap (COST = 1). juzhe.zh...@rivai.ai From: Robin Dapp Date: 2023-10-19 16:43 To: Juzhe-Zhong; gcc-patches CC: rdapp.gcc; kito.cheng; kito.cheng; jeffreyalaw Subject: Re: [PATCH V2] RISC-V: Fix failed hoist in LICM of vmv.v.x instruction Hi Juzhe, as discussed off-list this approach generally makes sense to me so the patch LGTM once the vsetvl rework is upstream and settled. Independently, we still need to understand why the more complex broadcast pattern is not hoisted out of the loop. Regards Robin