The middle-end pass NULL_TREE in previous, and then skip the adjust_stmt_cost step which has count the cost of vr2gpr. After Richard introduced more like slp_node with its vectype for recording the cost, the adjust_stmt_cost will be hit and plus the cost of vr2gpr now. And then fail to vectorize due to cost value changes of vr2gpr from 0 to 2.
That means we need to reconsider how to pass the cost value from the command line eventually. If we need to add more options for cost, shall we consider to introduce a config file for all possible costs values? It may look like a json file which contains sorts of cost num, instead of add it separately. (may have minor discuss with kito last summer I bet.) Pan -----Original Message----- From: Jeffrey Law <[email protected]> Sent: Monday, February 2, 2026 10:34 PM To: Li, Pan2 <[email protected]>; [email protected] Cc: [email protected]; [email protected]; [email protected]; [email protected]; Chen, Ken <[email protected]>; Liu, Hongtao <[email protected]> Subject: Re: [PATCH v1 1/2] RISC-V: Bugfix adjust_stmt_cost doesn't honor param=gpr2vr-cost [PR123916] On 2/2/2026 1:26 AM, Li, Pan2 wrote: > Maybe we need to introduce new option like 'vr2gpr-cost' here? Or just > consider they would be the same. > If we need a new option that indicate the cost from vr2gpr, this may not be > good fix up to a point. Totally agreed on the concern that the costs are not necessarily symmetic; in fact that's the case on Ventana's V2 uarch. You and Robin get to decide if/when we want to address with another param. jeff
