diff mbox series

[2/2] Disable add_store_equivs when -fno-expensive-optimizations

Message ID 20240924123542.8FA5D385C6D1@sourceware.org
State New
Headers show
Series [1/2] rtl-optimization/114855 - slow add_store_equivs in IRA | expand

Commit Message

Richard Biener Sept. 24, 2024, 12:35 p.m. UTC
IRAs add_store_equivs is quadratic in the size of the function worst
case, disable it when -fno-expensive-optimizations which means at
-O1 and -Og.

Bootstrap and regtest running on x86_64-unknown-linux-gnu.

OK?

Thanks,
Richard.

	* ira.cc (ira): Gate add_store_equivs on flag_expensive_optimizations.
---
 gcc/ira.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/gcc/ira.cc b/gcc/ira.cc
index 3936456c4ed..5231f63398e 100644
--- a/gcc/ira.cc
+++ b/gcc/ira.cc
@@ -5739,7 +5739,7 @@  ira (FILE *f)
     combine_and_move_insns ();
 
   /* Gather additional equivalences with memory.  */
-  if (optimize)
+  if (optimize && flag_expensive_optimizations)
     add_store_equivs ();
 
   loop_optimizer_finalize ();