aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2024-02-19 11:10:50 +0100
committerRichard Biener <rguenther@suse.de>2024-05-13 13:40:23 +0200
commitd629308c699bb8fe90c2afeb7fa1acb12cb5526b (patch)
tree428e8075073a998e6fe2f413381bde7f71629f08
parent6d1801f89309d3c5f6738577e28f1249f9e28fe3 (diff)
downloadgcc-d629308c699bb8fe90c2afeb7fa1acb12cb5526b.zip
gcc-d629308c699bb8fe90c2afeb7fa1acb12cb5526b.tar.gz
gcc-d629308c699bb8fe90c2afeb7fa1acb12cb5526b.tar.bz2
rtl-optimization/54052 - RTL SSA PHI insertion compile-time hog
The following tries to address the PHI insertion compile-time hog in RTL fwprop observed with the PR54052 testcase where the loop computing the "unfiltered" set of variables possibly needing PHI nodes for each block exhibits quadratic compile-time and memory-use. It does so by pruning the local DEFs with LR_OUT of the block, removing regs that can never be LR_IN (defined by this block) in the dominance frontier. PR rtl-optimization/54052 * rtl-ssa/blocks.cc (function_info::place_phis): Filter local defs by LR_OUT. (cherry picked from commit c7151283dc747769d4ac4f216d8f519bda2569b5)
-rw-r--r--gcc/rtl-ssa/blocks.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/rtl-ssa/blocks.cc b/gcc/rtl-ssa/blocks.cc
index 1f9969d..0ee9fa0 100644
--- a/gcc/rtl-ssa/blocks.cc
+++ b/gcc/rtl-ssa/blocks.cc
@@ -639,7 +639,12 @@ function_info::place_phis (build_info &bi)
if (bitmap_empty_p (&frontiers[b1]))
continue;
- bitmap b1_def = &DF_LR_BB_INFO (BASIC_BLOCK_FOR_FN (m_fn, b1))->def;
+ // Defs in B1 that are possibly in LR_IN in the dominance frontier
+ // blocks.
+ auto_bitmap b1_def;
+ bitmap_and (b1_def, &DF_LR_BB_INFO (BASIC_BLOCK_FOR_FN (m_fn, b1))->def,
+ DF_LR_OUT (BASIC_BLOCK_FOR_FN (m_fn, b1)));
+
bitmap_iterator bmi;
unsigned int b2;
EXECUTE_IF_SET_IN_BITMAP (&frontiers[b1], 0, b2, bmi)