Re: [PATCH v2] bpf: add inline memmove and memcpy expansion

2024-02-20 Thread David Faust
On 2/20/24 12:37, Jose E. Marchesi wrote: > > Hi Faust. > >> +bool >> +bpf_expand_cpymem (rtx *operands, bool is_move) >> +{ >> + /* Size must be constant for this expansion to work. */ >> + if (!CONST_INT_P (operands[2])) >> +{ >> + const char *name = is_move ? "memmove" :

Re: [PATCH v2] bpf: add inline memmove and memcpy expansion

2024-02-20 Thread Jose E. Marchesi
Hi Faust. > +bool > +bpf_expand_cpymem (rtx *operands, bool is_move) > +{ > + /* Size must be constant for this expansion to work. */ > + if (!CONST_INT_P (operands[2])) > +{ > + const char *name = is_move ? "memmove" : "memcpy"; > + if (flag_building_libgcc) > + warning

[PATCH v2] bpf: add inline memmove and memcpy expansion

2024-02-20 Thread David Faust
[Changes from v1: Jose's review comments, all of which I agree with. - Fix 'implments' typo in commit message. - Change check that alignment is CONST_INT to gcc_assert (). - Change default case in alignment switch to gcc_unreachable (). - Reword error message for non-constant size