Re: [PATCH] expand: Add trivial folding for bit query builtins at expansion time [PR114044]

2024-02-27 Thread Jakub Jelinek
On Tue, Feb 27, 2024 at 09:51:05AM +0100, Richard Biener wrote: > On Tue, 27 Feb 2024, Jakub Jelinek wrote: > > > On Tue, Feb 27, 2024 at 09:35:43AM +0100, Richard Biener wrote: > > > I do wonder whether we can handle the missing LHS case generically > > > in the direct optab expander for fns that

Re: [PATCH] expand: Add trivial folding for bit query builtins at expansion time [PR114044]

2024-02-27 Thread Richard Biener
On Tue, 27 Feb 2024, Jakub Jelinek wrote: > On Tue, Feb 27, 2024 at 09:35:43AM +0100, Richard Biener wrote: > > I do wonder whether we can handle the missing LHS case generically > > in the direct optab expander for fns that are PURE or CONST? > > Maybe the 2 operand expand_internal_call could do

Re: [PATCH] expand: Add trivial folding for bit query builtins at expansion time [PR114044]

2024-02-27 Thread Jakub Jelinek
On Tue, Feb 27, 2024 at 09:35:43AM +0100, Richard Biener wrote: > I do wonder whether we can handle the missing LHS case generically > in the direct optab expander for fns that are PURE or CONST? Maybe the 2 operand expand_internal_call could do it before handing over to individual expanders. Can

Re: [PATCH] expand: Add trivial folding for bit query builtins at expansion time [PR114044]

2024-02-27 Thread Richard Biener
On Tue, 27 Feb 2024, Jakub Jelinek wrote: > Hi! > > While it seems a lot of places in various optimization passes fold > bit query internal functions with INTEGER_CST arguments to INTEGER_CST > when there is a lhs, when lhs is missing, all the removals of such dead > stmts are guarded with -ftree

[PATCH] expand: Add trivial folding for bit query builtins at expansion time [PR114044]

2024-02-27 Thread Jakub Jelinek
Hi! While it seems a lot of places in various optimization passes fold bit query internal functions with INTEGER_CST arguments to INTEGER_CST when there is a lhs, when lhs is missing, all the removals of such dead stmts are guarded with -ftree-dce, so with -fno-tree-dce those unfolded ifn calls re