Andrew Pinski a51bf9e101 ifcvt: Fix ifcvt for multiple phi nodes after factoring operator [PR121236]
When I added the factor operations to ifcvt, I messed how handling of removing
the phi nodes. The fix is we need to remove the phi node that was factored out
as we factored out the operator because otherwise scev can go when it comes
to detecting if the new args are from a reduction.

Also the need to change the interface for is_cond_scalar_reduction as the
phi node that was being passed after the factoring no longer exists so need
to pass the parts that were being used.

	PR tree-optimization/121236

gcc/ChangeLog:

	* tree-if-conv.cc (is_cond_scalar_reduction): Instead of phi argument,
	pass bb and res of the phi.
	(factor_out_operators): Add iterator for the phi. Remove the phi
	if this is the first time. Return if we had removed the phi.
	(predicate_scalar_phi): Add the phi iterator argument.
	Update call to is_cond_scalar_reduction.
	Update call to factor_out_operators and set the return value to true
	when factor_out_operators returns true.
	(predicate_all_scalar_phis): Don't remove the phi if predicate_scalar_phi
	already removed it.

gcc/testsuite/ChangeLog:

	* gcc.dg/torture/pr121236-1.c: New test.

Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
2025-07-28 10:24:51 -07:00
2024-07-12 00:17:52 +00:00
2025-05-23 00:17:35 +00:00
2025-07-26 00:19:51 +00:00
2025-07-26 00:19:51 +00:00
2025-07-18 00:19:21 +00:00
2025-07-14 00:16:48 +00:00
2025-07-24 00:20:56 +00:00
2025-07-22 00:19:29 +00:00
2025-07-10 00:20:18 +00:00
2025-07-23 00:20:17 +00:00
2021-12-21 09:10:57 +01:00
2008-09-26 16:21:02 +00:00
2014-11-16 14:07:13 +00:00

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.
Description
No description provided
Readme 1.8 GiB
Languages
C++ 31%
C 30.2%
Ada 15%
D 6.3%
Go 5.9%
Other 11.1%