https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117467

--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> ---
One issue with the dataflow problem is that it doesn't fit what
df_simple_dataflow expects - using

static bool ext_dce_rd_confluence_n (edge) { return true; }

will cause _all_ blocks to be iterated all the time, the idea is that
ext_dce_rd_transfer_n would, from live_out compute live_in (rather than
mangling both into its single 'livein' bitmap) and compute live_out
in ext_dce_rd_confluence_n from the successors live_in, only returning
true if live_out changed.

That this bug is now defered to stage4 makes a proper complete rewrite (sic!)
hardly possible.

Most of the problem looks like computing LR but we're intermangling this
with using LR as it evolves throughout the BB with defs to do the actual
ext-dce.  Why's this not simply using DF LR and doing a _single_ backward
walk performing the ext-dce?!

As said, I think this pass needs to be re-done from scratch, eventually
just killed off again for now (not to mention it's the triple duplicate
of similar functionality elsehwere...).

Alternatively it looks like memory should grow linearly with max_reg_num * 4 *
n_basic_blocks_for_fn, so disabling the pass when this becomes large is
necessary.  OTOH I hardly can see how this would get us to 25GB, so something
else is might be broken here.  For module_first_rk_step_part1.fppized.f90 we
have max_reg_num == 262610 and last_basic_block is 32042, with full 'livein'
this would amount to around 8GB of bitmap memory (4 bits per reg, 50%
overhead).

I have a patch limiting us based on this like we do limit GCSE based passes.
We already do

Warning: const/copy propagation disabled: 36613 basic blocks and 247372
registers; increase '--param max-gcse-memory' above 1105827
[-Wdisabled-optimization]
module_first_rk_step_part1.fppized.f90:1315:36: Warning: PRE disabled: 36613
basic blocks and 247372 registers; increase '--param max-gcse-memory' above
1105827 [-Wdisabled-optimization]
module_first_rk_step_part1.fppized.f90:1315:36: Warning: const/copy propagation
disabled: 36613 basic blocks and 247372 registers; increase '--param
max-gcse-memory' above 1105827 [-Wdisabled-optimization]

Reply via email to