From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 575133877435; Mon, 28 Jun 2021 16:28:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 575133877435 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/93385] [10/11/12 Regression] wrong code with u128 modulo at -O2 -fno-dce -fno-ipa-cp -fno-tree-dce Date: Mon, 28 Jun 2021 16:28:04 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 10.0 X-Bugzilla-Keywords: diagnostic, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: jamborm at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jun 2021 16:28:06 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D93385 --- Comment #45 from CVS Commits --- The master branch has been updated by Martin Jambor : https://gcc.gnu.org/g:87467f45e831e8e943efdae8920453741986d355 commit r12-1847-g87467f45e831e8e943efdae8920453741986d355 Author: Martin Jambor Date: Mon Jun 28 18:20:00 2021 +0200 ipa-sra: Restructure how cloning and call redirection communicate (PR 93385) I was asked by Richi to split my fix for PR 93385 for easier review into IPA-SRA materialization refactoring and the actual DCE addition. Fortunately it was mostly natural except for a temporary weird condition in ipa_param_body_adjustments::modify_call_stmt. Additionally. In addition to the patch I posted previously, this one also deallocated the newly added summary in toplev::finalize and fixes a mistakenly uninitialized field. This is the first part which basically replaces performed_splits in clone_info and the code which generates it, keeps it up-to-date and consumes it with new edge summaries which are much nicer. It simply contains 1) a mapping from the original argument indices to the actual indices in the call statement as it is now, 2) information needed to identify arguments representing pass-through IPA-SRA splits with which have been added to the call arguments in place of an original argument/reference and 3) a delta to the index where va_args may start - so basically directly all the information that the consumer of performed_splits had to compute and we also do not need the weird dummy declarations. The main disadvantage is that the information has to be created (and kept up-to-date) for all call graph edges associated with the given statement from all clones (including inline clones) of the clone where splitting or removal happened first. But all of this happens during clone materialization so the only effect on WPA memory consumption is the removal of a pointer from clone_info. The statement modification code also has to know the statement from the original function in order to be able to locate the edge summaries which at this point are still keyed to these. However, the code is already quite heavily dependant on how things are structured in tree-inline.c and in order to fix bugs like these it probably has to be. The subsequent patch needs this new information to be able to remove arguments from calls during materialization and communicate this information to the call redirection. gcc/ChangeLog: 2021-05-17 Martin Jambor PR ipa/93385 * symtab-clones.h (clone_info): Removed member param_adjustment= s. * ipa-param-manipulation.h: Adjust initial comment to reflect h= ow we deal with pass-through splits now. (ipa_param_performed_split): Removed. (ipa_param_adjustments::modify_call): Adjusted parameters. (class ipa_param_body_adjustments): Adjusted parameters of register_replacement, modify_gimple_stmt and modify_call_stmt. (ipa_verify_edge_has_no_modifications): Declare. (ipa_edge_modifications_finalize): Declare. * cgraph.c (cgraph_edge::redirect_call_stmt_to_callee): Remove performed_splits processing, pas only edge to padjs->modify_cal= l, check that call arguments were not modified if they should not = have been. * cgraphclones.c (cgraph_node::create_clone): Do not copy perfo= rmed splits. * ipa-param-manipulation.c (struct pass_through_split_map): New type. (ipa_edge_modification_info): Likewise. (ipa_edge_modification_sum): Likewise. (ipa_edge_modifications): New edge summary. (ipa_verify_edge_has_no_modifications): New function. (transitive_split_p): Removed. (transitive_split_map): Likewise. (init_transitive_splits): Likewise. (ipa_param_adjustments::modify_call): Adjusted to use the new e= dge summary instead of performed_splits. (ipa_param_body_adjustments::register_replacement): Drop dummy parameter, set base_index of the created ipa_param_body_replacement. (phi_arg_will_live_p): New function. (ipa_param_body_adjustments::common_initialization): Do not cre= ate IPA_SRA dummy decls. (simple_tree_swap_info): Removed. (remap_split_decl_to_dummy): Likewise. (record_argument_state_1): New function. (record_argument_state): Likewise. (ipa_param_body_adjustments::modify_call_stmt): New parameter orig_stmt. Do not work with dummy decls, save necessary info a= bout changes to ipa_edge_modifications. (ipa_param_body_adjustments::modify_gimple_stmt): New parameter orig_stmt, pass it to modify_call_stmt. (ipa_param_body_adjustments::modify_cfun_body): Adjust call to modify_gimple_stmt. (ipa_edge_modifications_finalize): New function. * tree-inline.c (remap_gimple_stmt): Pass original statement to modify_gimple_stmt. (copy_phis_for_bb): Do not copy dead PHI nodes. (expand_call_inline): Do not remap performed_splits. (update_clone_info): Likewise. * toplev.c: Include ipa-param-manipulation.h. (toplev::finalize): Call ipa_edge_modifications_finalize.=