Thanks Robin. I see, we will go the middle-end IFN way instead of the target approach like this. Feel free to ping me anything I can help.
Pan -----Original Message----- From: Robin Dapp <[email protected]> Sent: Thursday, November 6, 2025 6:13 PM To: Li, Pan2 <[email protected]>; Robin Dapp <[email protected]>; [email protected] Cc: [email protected]; [email protected]; [email protected]; Chen, Ken <[email protected]>; Liu, Hongtao <[email protected]>; Robin Dapp <[email protected]> Subject: Re: [PATCH v1] RISC-V: Combine vsext.vf2 and vsll.vi to vwsll.vi on ZVBB > I see, thanks Robin. Let's hold on for a while. IMHO this can go forward now. For documentation purposes: I experimented with adding widening shifts via optabs/vectorizer directly and while it's possible it is IMHO too much rework. There's a clear path forward: - Make widen lshift an IFN, the patch is already accepted but causes regressions on arm. - To fix those regressions we need to distinguish between shift by scalar and shift by vector, as arm only supports the former. - For properly distinguishing the variants we need to replicate what vectorizable_shift does, which includes checking other SLP lanes, as well as initializing a vector constant if necessary. This needs to be combined with supportable_widening_operation. - supportable_widening_operation needs to be able to handle "SLP style"/n-n widening operations. This can be achieved by adding an IFN path to supportable_half_widening_operation and not using vect_create_half_widening_stmts on that path. I have a patch for this that I tested with widening left shift, vec_widen_add/sub, and widen_sum. -- Regards Robin
