Re: [PATCH v2] fold fold_truth_andor field merging into ifcombine

2024-12-09 Thread Alexandre Oliva
On Dec 8, 2024, Richard Biener wrote: > Like below, gimple_convert_def_p (). >> +static bool >> +gimple_fold_follow_convert (tree t, tree op[1]) > Since it doesn't actually fold - can you name it > static bool > gimple_binop_def_p (...) >> + if (tree_swap_operands_p (op0, op1)) >> +

Re: [PATCH v2] fold fold_truth_andor field merging into ifcombine

2024-12-08 Thread Richard Biener
On Sun, Dec 8, 2024 at 11:17 AM Alexandre Oliva wrote: > > Here's yet another incremental patchlet, with the changes made in > response to your review to v2. > > I'll post v3 containing it momentarily, but this incremental is supposed > to make it easier to review. > > diff --git a/gcc/c-family/c.

Re: [PATCH v2] fold fold_truth_andor field merging into ifcombine

2024-12-08 Thread Alexandre Oliva
Here's yet another incremental patchlet, with the changes made in response to your review to v2. I'll post v3 containing it momentarily, but this incremental is supposed to make it easier to review. diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt index 0d255561b1bdc..be7916e957d66 100644 ---

Re: [PATCH v2] fold fold_truth_andor field merging into ifcombine

2024-12-07 Thread Alexandre Oliva
On Dec 3, 2024, Richard Biener wrote: > On Fri, Nov 22, 2024 at 10:22 PM Alexandre Oliva wrote: >> + /* Identify the load, if there is one. */ >> + if (TREE_CODE (exp) == SSA_NAME >> + && !SSA_NAME_IS_DEFAULT_DEF (exp)) >> +{ >> + gimple *def = SSA_NAME_DEF_STMT (exp); >> +

Re: [PATCH v2] fold fold_truth_andor field merging into ifcombine

2024-12-05 Thread Richard Biener
On Thu, Dec 5, 2024 at 1:39 PM Alexandre Oliva wrote: > > Hi, > > Thanks for the review. > > I hadn't seen your response yet, and for days I have been just about to > send v3 with some incremental changes. > > Here they are, for the record. They fix a bug I had introduced while > converting const

Re: [PATCH v2] fold fold_truth_andor field merging into ifcombine

2024-12-05 Thread Alexandre Oliva
Hi, Thanks for the review. I hadn't seen your response yet, and for days I have been just about to send v3 with some incremental changes. Here they are, for the record. They fix a bug I had introduced while converting constants and masks to wide_int, simplifies some internal APIs, reworks some

Re: [PATCH v2] fold fold_truth_andor field merging into ifcombine

2024-12-03 Thread Richard Biener
On Fri, Nov 22, 2024 at 10:22 PM Alexandre Oliva wrote: > > > This patch introduces various improvements to the logic that merges > field compares, while moving it into ifcombine. > > Before the patch, we could merge: > > (a.x1 EQNE b.x1) ANDOR (a.y1 EQNE b.y1) > > into something like: > > (

Re: [PATCH v2] fold fold_truth_andor field merging into ifcombine

2024-11-27 Thread Alexandre Oliva
On Nov 22, 2024, Alexandre Oliva wrote: > - Rework BIT_XOR handling to avoid having to match patterns again. I goofed here, and only an -O3 profiling bootstrap of gcc-14 caught it. Please consider this incremental patchlet as if included as part of the previous one. Bootstrapped on top of the o

[PATCH v2] fold fold_truth_andor field merging into ifcombine

2024-11-22 Thread Alexandre Oliva
This patch introduces various improvements to the logic that merges field compares, while moving it into ifcombine. Before the patch, we could merge: (a.x1 EQNE b.x1) ANDOR (a.y1 EQNE b.y1) into something like: (((type *)&a)[Na] & MASK) EQNE (((type *)&b)[Nb] & MASK) if both of A's fie