Skip to content
Snippets Groups Projects
Commit 7766a2c1 authored by Andre Vieira's avatar Andre Vieira
Browse files

arm: Fix missed CE optimization for armv8.1-m.main [PR 116444]

This patch restores missed optimizations for armv8.1-m.main targets that were
missed when the generation of csinc, csinv and csneg were enabled for the same
with patch series containing:

commit c2bb84be
Author: Sudi Das <sudi.das@arm.com>
Date:   Fri Sep 18 15:47:46 2020 +0100

    [PATCH 2/5][Arm] New pattern for CSINV instructions

The original patch series makes use of the "noce" machinery to transform RTL
into patterns that later match the Armv8.1-M Mainline, by getting the target
hook TARGET_HAVE_CONDITIONAL_EXECUTION, to return FALSE for such targets prior
to reload_completed.  The same machinery however was transforming other RTL
patterns which were later on causing the "ce" pass post reload_completed to no
longer optimize conditional execution opportunities, which was causing the
regression observed in PR target/116444, a regression of 'testsuite/gcc.target/arm/thumb-ifcvt-2.c'
when ran for an Armv8.1-M Mainline target.

This patch implements the target hook TARGET_NOCE_CONVERSION_PROFITABLE_P to
only allow "noce" to generate patterns that match CSINV, CSINC and CSNEG.  Thus
ensuring that the early "ce" passes do not ruin things for later ones.

gcc/ChangeLog:

	PR target/116444
	* config/arm/arm-protos.h (arm_noce_conversion_profitable_p): New
	declaration.
	* config/arm/arm.cc (arm_is_v81m_cond_insn): New helper function used
	in ...
	(arm_noce_conversion_profitable_p): ... here. New function to implement
	...
	(TARGET_NOCE_PROFITABLE_P): ... this target hook.  New define.
parent 16cd00a1
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment