Re: [PATCH] backprop: Fix deleting of a phi node [PR116922]

2024-10-02 Thread Richard Biener
On Wed, Oct 2, 2024 at 5:13 AM Andrew Pinski wrote: > > The problem here is remove_unused_var is called on a name that is > defined by a phi node but it deletes it like removing a normal statement. > remove_phi_node should be called rather than gsi_remove for phinodes. > > Note there is a possibil

[PATCH] backprop: Fix deleting of a phi node [PR116922]

2024-10-01 Thread Andrew Pinski
The problem here is remove_unused_var is called on a name that is defined by a phi node but it deletes it like removing a normal statement. remove_phi_node should be called rather than gsi_remove for phinodes. Note there is a possibility of using simple_dce_from_worklist instead but that is for an