Richard Biener <rguent...@suse.de> writes:

> On Tue, 9 Jan 2024, Tamar Christina wrote:
>
>> > > -
>> > > -      gimple_seq_add_seq (&stmts, tem);
>> > > -
>> > > -      scalar_res = gimple_build (&stmts, CFN_EXTRACT_LAST, scalar_type,
>> > > -                                 mask, vec_lhs_phi);
>> > > +        scalar_res = gimple_build (&stmts, CFN_VEC_EXTRACT, TREE_TYPE
>> > (vectype),
>> > > +                                   vec_lhs_phi, bitstart);
>> > 
>> > So bitstart is always zero?  I wonder why using CFN_VEC_EXTRACT over
>> > BIT_FIELD_REF here which wouldn't need any additional target support.
>> > 
>> 
>> Ok, how about...
>> 
>> ---
>> 
>> I was generating the vector reverse mask without checking if the target
>> actually supported such an operation.
>> 
>> This patch changes it to if the bitstart is 0 then use BIT_FIELD_REF instead
>> to extract the first element since this is supported by all targets.
>> 
>> This is good for now since masks always come from whilelo.  But in the future
>> when masks can come from other sources we will need the old code back.
>> 
>> Bootstrapped Regtested on aarch64-none-linux-gnu, x86_64-pc-linux-gnu
>> and no issues with --enable-checking=release --enable-lto
>> --with-build-config=bootstrap-O3 --enable-checking=yes,rtl,extra.
>> tested on cross cc1 for amdgcn-amdhsa and issue fixed.
>> 
>> Ok for master?
>
> OK.
>
>> Thanks,
>> Tamar
>> 
>> gcc/ChangeLog:
>> 
>>      PR tree-optimization/113199
>>      * tree-vect-loop.cc (vectorizable_live_operation_1): Use
>>      BIT_FIELD_REF.

This patch broke bootstrap (everywhere, it seems; seen on
i386-pc-solaris2.11 and sparc-sun-solaris2.11):

/vol/gcc/src/hg/master/local/gcc/tree-vect-loop.cc: In function 'tree_node* 
vectorizable_live_operation_1(loop_vec_info, stmt_vec_info, basic_block, tree, 
int, slp_tree, tree, tree, tree, tree, bool, gimple_stmt_iterator*)':
/vol/gcc/src/hg/master/local/gcc/tree-vect-loop.cc:10598:52: error: unused 
parameter 'restart_loop' [-Werror=unused-parameter]
10598 |                                tree lhs_type, bool restart_loop,
      |                                               ~~~~~^~~~~~~~~~~~

        Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

Reply via email to