public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/113078] New: [14 regression] reduction of cond_sub is not vectorized.
@ 2023-12-19  3:53 liuhongt at gcc dot gnu.org
  2023-12-19  3:59 ` [Bug tree-optimization/113078] " pinskia at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: liuhongt at gcc dot gnu.org @ 2023-12-19  3:53 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 113078
           Summary: [14 regression] reduction of cond_sub is not
                    vectorized.
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: liuhongt at gcc dot gnu.org
  Target Milestone: ---

int
foo (int n, int* p, int* pi)
{
    int sum = 0;
    for (int i = 0; i != n; i++)
    {
        if (pi[i] > 0)
          sum -= p[i];
    }
    return sum;
}

gcc 13 can vectorize it, but latest trunk don't, guess it's related to
optimiztion of COND_OP in ifcvt.

/app/example.cpp:5:23: note:   vect_is_simple_use: vectype vector(8) int
/app/example.cpp:5:23: missed:   reduction: not commutative/associative
/app/example.cpp:2:1: missed:   not vectorized: relevant phi not supported:
sum_18 = PHI <_ifc__32(8), 0(18)>
/app/example.cpp:5:23: missed:  bad operation or unsupported loop bound.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-01-10 14:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-19  3:53 [Bug tree-optimization/113078] New: [14 regression] reduction of cond_sub is not vectorized liuhongt at gcc dot gnu.org
2023-12-19  3:59 ` [Bug tree-optimization/113078] " pinskia at gcc dot gnu.org
2023-12-19  9:05 ` rguenth at gcc dot gnu.org
2024-01-10 14:26 ` cvs-commit at gcc dot gnu.org
2024-01-10 14:27 ` rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).