This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA:] cse.c (fold_rtx): Find cheaper comparison equivalent (was: Patches ping...)


On Tue, 31 Jan 2006, Hans-Peter Nilsson wrote:
> 	* cse.c (fold_rtx) <case RTX_COMM_COMPARE, RTX_COMPARE>: When arg1
> 	has a constant equivalent, iterate over equivalents for arg0,
> 	calling simplify_relational_operation and if there's a result
> 	cheaper than X, apply fold_rtx and return the result.

Ok for mainline with one very minor improvement:

> +			  cost = COST (simp_result);
> +			  if (cost < cheapest_cost)
> +			    {
> +			      cheapest_cost = COST (simp_result);

You can use "cost" in the assignment to cheapest_cost above and
save yourself a duplicate call to rtx_costs via COST.

Thanks for taking the time to implement this suggestion.
Now to investigate (or file enhancement PRs) for the RTL optimizations
suggested above that aren't yet implemented in simplify-rtx.c :)

Roger
--


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]