This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Implement more rtx vector folds on variable-length vectors
- From: Jeff Law <law at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org, richard dot sandiford at arm dot com
- Date: Mon, 22 Jul 2019 12:17:38 -0600
- Subject: Re: Implement more rtx vector folds on variable-length vectors
- References: <mptwogpkndf.fsf@arm.com> <mptef2rco33.fsf@arm.com>
On 7/15/19 9:30 AM, Richard Sandiford wrote:
> Richard Sandiford <richard.sandiford@arm.com> writes:
>> This patch extends the tree-level folding of variable-length vectors
>> so that it can also be used on rtxes. The first step is to move
>> the tree_vector_builder new_unary/binary_operator routines to the
>> parent vector_builder class (which in turn means adding a new
>> template parameter). The second step is to make simplify-rtx.c
>> use a direct rtx analogue of the VECTOR_CST handling in fold-const.c.
>>
>> Tested on aarch64-linux-gnu, aarch64_be-elf and x86_64-linux-gnu.
>> OK to install?
>>
>> Richard
>
> Here's a version updated for the earlier patch, so that we take
> both HONOR_NANS and HONOR_SNANS into account. Tested on
> aarch64-linux-gnu to far.
>
> Thanks,
> Richard
>
>
> 2019-07-15 Richard Sandiford <richard.sandiford@arm.com>
>
> gcc/
> * rtl.h (bit_and_conditions, bit_ior_conditions): Declare.
> * jump.c (flags_to_condition): Add an honor_nans_p argument.
> (bit_ior_conditions, bit_and_conditions): New functions.
> * simplify-rtx.c (simplify_binary_operation_1): Try to fold an
> AND or IOR of two comparisons into a single comparison.
> (simplify_ternary_operation): Try to fold an if_then_else involving
> two conditions into an AND of two conditions.
> (test_merged_comparisons): New function.
> (simplify_rtx_c_tests): Call it.
This is fine once the prereqs are approved.
jeff