Re: [PATCH] tree, c++: optimize walk_tree_1 and cp_walk_subtrees

2023-04-21 Thread Patrick Palka via Gcc-patches
ments. > > > > > > Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for > > > trunk stage3 or perhaps for stage1? > > OK for stage 1. Thanks, I just pushed this along with a drive-by change to cp_walk_subtrees to use cp_unevaluated instead of

Re: [PATCH] tree, c++: optimize walk_tree_1 and cp_walk_subtrees

2022-12-05 Thread Jason Merrill via Gcc-patches
On 12/5/22 06:09, Prathamesh Kulkarni wrote: On Mon, 5 Dec 2022 at 09:51, Patrick Palka via Gcc-patches wrote: These functions currently repeatedly dereference tp during the subtree walk, dereferences which the compiler can't CSE because it can't guarantee that the subtree walking doesn't

Re: [PATCH] tree, c++: optimize walk_tree_1 and cp_walk_subtrees

2022-12-05 Thread Patrick Palka via Gcc-patches
On Mon, 5 Dec 2022, Prathamesh Kulkarni wrote: > On Mon, 5 Dec 2022 at 09:51, Patrick Palka via Gcc-patches > wrote: > > > > These functions currently repeatedly dereference tp during the subtree > > walk, dereferences which the compiler can't CSE because it can't > > guarantee that the subtree

Re: [PATCH] tree, c++: optimize walk_tree_1 and cp_walk_subtrees

2022-12-05 Thread Prathamesh Kulkarni via Gcc-patches
On Mon, 5 Dec 2022 at 09:51, Patrick Palka via Gcc-patches wrote: > > These functions currently repeatedly dereference tp during the subtree > walk, dereferences which the compiler can't CSE because it can't > guarantee that the subtree walking doesn't modify *tp. > > But we already implicitly

[PATCH] tree, c++: optimize walk_tree_1 and cp_walk_subtrees

2022-12-04 Thread Patrick Palka via Gcc-patches
These functions currently repeatedly dereference tp during the subtree walk, dereferences which the compiler can't CSE because it can't guarantee that the subtree walking doesn't modify *tp. But we already implicitly require that TREE_CODE (*tp) remains the same throughout the subtree walks, so