[PATCH] ipa-sra: Allow IPA-SRA in presence of returns which will be removed

Jan Hubicka hubicka@ucw.cz
Mon Sep 25 08:47:17 GMT 2023


> >> gcc/ChangeLog:
> >>
> >> 2023-08-18  Martin Jambor  <mjambor@suse.cz>
> >>
> >> 	PR ipa/110378
> >> 	* ipa-param-manipulation.cc
> >> 	(ipa_param_body_adjustments::mark_dead_statements): Verify that any
> >> 	return uses of PARAM will be removed.
> >> 	(ipa_param_body_adjustments::mark_clobbers_dead): Likewise.
> >> 	* ipa-sra.cc (isra_param_desc): New fields
> >> 	remove_only_when_retval_removed and split_only_when_retval_removed.
> >> 	(struct gensum_param_desc): Likewise.  Fix comment long line.
> >> 	(ipa_sra_function_summaries::duplicate): Copy the new flags.
> >> 	(dump_gensum_param_descriptor): Dump the new flags.
> >> 	(dump_isra_param_descriptor): Likewise.
> >> 	(isra_track_scalar_value_uses): New parameter desc.  Set its flag
> >> 	remove_only_when_retval_removed when encountering a simple return.
> >> 	(isra_track_scalar_param_local_uses): Replace parameter call_uses_p
> >> 	with desc.  Pass it to isra_track_scalar_value_uses and set its
> >> 	call_uses.
> >> 	(ptr_parm_has_nonarg_uses): Accept parameter descriptor as a
> >> 	parameter.  If there is a direct return use, mark any..
> >> 	(create_parameter_descriptors): Pass the whole parameter descriptor to
> >> 	isra_track_scalar_param_local_uses and ptr_parm_has_nonarg_uses.
> >> 	(process_scan_results): Copy the new flags.
> >> 	(isra_write_node_summary): Stream the new flags.
> >> 	(isra_read_node_info): Likewise.
> >> 	(adjust_parameter_descriptions): Check that transformations
> >> 	requring return removal only happen when return value is removed.
> >> 	Restructure main loop.  Adjust dump message.
> >>
> >> gcc/testsuite/ChangeLog:
> >>
> >> 2023-08-18  Martin Jambor  <mjambor@suse.cz>
> >>
> >> 	PR ipa/110378
> >> 	* gcc.dg/ipa/ipa-sra-32.c: New test.
> >> 	* gcc.dg/ipa/pr110378-4.c: Likewise.
> >> 	* gcc.dg/ipa/ipa-sra-4.c: Use a return value.
> >> ---
> >>  gcc/ipa-param-manipulation.cc         |   7 +-
> >>  gcc/ipa-sra.cc                        | 247 +++++++++++++++++---------
> >>  gcc/testsuite/gcc.dg/ipa/ipa-sra-32.c |  30 ++++
> >>  gcc/testsuite/gcc.dg/ipa/ipa-sra-4.c  |   4 +-
> >>  gcc/testsuite/gcc.dg/ipa/pr110378-4.c |  50 ++++++
> >>  5 files changed, 251 insertions(+), 87 deletions(-)
> >>  create mode 100644 gcc/testsuite/gcc.dg/ipa/ipa-sra-32.c
> >>  create mode 100644 gcc/testsuite/gcc.dg/ipa/pr110378-4.c
> >>

OK,
Thanks
Honza


More information about the Gcc-patches mailing list