https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119919

Jan Hubicka <hubicka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Depends on|                            |119902

--- Comment #3 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
C equivalent is:
int a[9*9];
bool b[9];
void test()
{
        for (int i = 0; i < 9; i++)
        {
                b[i] = a[i*9] != 0;
        }
}


there are two problems.  First is costing of the open-coded gather. This is
PR119902.
Second problem is that we over-estimate cost of 

  _7 = sudoku1[_6];
  _8 = _7 != 0; 

for some reason vectorizer does:

_7 != 0 4 times vector_stmt costs 16 in body
<unknown> 1 times vector_load costs 12 in prologue
_8 ? 1 : 0 4 times vector_stmt costs 64 in body

_8 ? 1 : 0 is redundant (since _8 is already either 1 or 0) and, moreover,
over-costed.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119902
[Bug 119902] open-coded scatter/gather should not account vec_to_scalar cost

Reply via email to