This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Decrease # of update_stmt calls from alias analysis
- From: Diego Novillo <dnovillo at redhat dot com>
- To: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- Cc: gcc-patches at gcc dot gnu dot org, Michael Matz <matz at suse dot de>, Andrew MacLeod <amacleod at redhat dot com>, dberlin at dberlin dot org
- Date: Wed, 01 Mar 2006 09:20:20 -0500
- Subject: Re: [patch] Decrease # of update_stmt calls from alias analysis
- References: <20060227170004.GA9176@atrey.karlin.mff.cuni.cz> <1141149999.10812.362.camel@localhost.localdomain> <Pine.LNX.4.58.0602281908051.20821@wotan.suse.de> <1141154104.6054.27.camel@localhost> <20060301102318.GA19301@atrey.karlin.mff.cuni.cz> <44059442.6020900@redhat.com> <20060301134815.GA28296@atrey.karlin.mff.cuni.cz>
On 03/01/06 08:48, Zdenek Dvorak wrote:
> huh? No benefit??? I thought the reduction of number of update_stmt
> calls is self-explanatory, but just to make it clear -- this patch
> improves compile time measurably, for example by almost 1% on combine.i at
> -O2.
>
And why didn't you include this information in your report? The fact
that you reduce the number of calls to a certain function may be
irrelevant in the grand scheme of things. You really have to spell
things out in more detail in your analysis.
> Given that the point of the patch is to avoid need to scan the
> statement, this does not seem like a good solution to me.
>
stmt_references_memory_p does not scan the statement. However, it will
notice zero memory operands before the first alias pass.
The simple fix is to remove this circular dependency. Modify the
function to directly examine the statement. Notice that, structurally,
it is not hard to tell whether a GIMPLE statement will reference memory:
1- Assignments.
2- Call sites.
3- ASMs
A predicate along these lines should work (may need more tweaking):
1- TREE_CODE (stmt) == MODIFY_EXPR
&& (TREE_CODE_CLASS (lhs) == tcc_reference
|| TREE_CODE_CLASS (rhs) == tcc_reference)
2- get_call_expr_in != NULL
3- TREE_CODE (stmt) == ASM_EXPR
No other statement should be allowed to memory loads/stores.