public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/115484] New: AVX vectorization is limited to 3 comparisons
@ 2024-06-14  4:14 andi-gcc at firstfloor dot org
  2024-06-14  5:51 ` [Bug tree-optimization/115484] if-to-switch prevents AVX vectorization rguenth at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: andi-gcc at firstfloor dot org @ 2024-06-14  4:14 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 115484
           Summary: AVX vectorization is limited to 3 comparisons
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: andi-gcc at firstfloor dot org
  Target Milestone: ---

With current trunk, but also older gcc

int f(char *s)
{
        int c = 0;
        int i;
        for (i = 0; i < 64; i++) {
                c |=  (*s == ',' || *s == '|' || *s == '!' /* || *s == '*' */);
                s++;
        }
        return c;
}

vectorizes with -O3 -mavx2  -fopt-info-optall-all tvcmp.c

tvcmp.c:6:16: optimized: loop vectorized using 16 byte vectors
tvcmp.c:2:5: note: vectorized 1 loops in function.
tvcmp.c:7:10: optimized: loop with 3 iterations completely unrolled (header
execution count 16535624)


but when the fourth comparison is commented in it doesn't:

BB 3 is always executed in loop 1
loop 1's coldest_outermost_loop is 1, hotter_than_inner_loop is NULL
tvcmp.c:6:16: missed: couldn't vectorize loop
tvcmp.c:6:16: missed: not vectorized: unsupported control flow in loop.
tvcmp.c:2:5: note: vectorized 0 loops in function.
tvcmp.c:10:9: note: ***** Analysis failed with vector mode V16QI
tvcmp.c:10:9: note: ***** Skipping vector mode V16QI, which would repeat the
analysis for V16QI

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

end of thread, other threads:[~2024-06-21 22:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-14  4:14 [Bug tree-optimization/115484] New: AVX vectorization is limited to 3 comparisons andi-gcc at firstfloor dot org
2024-06-14  5:51 ` [Bug tree-optimization/115484] if-to-switch prevents AVX vectorization rguenth at gcc dot gnu.org
2024-06-15  0:54 ` [Bug tree-optimization/115484] [11/12/13/14/15 regression] " sjames at gcc dot gnu.org
2024-06-15  1:02 ` [Bug tree-optimization/115484] [13/14/15 " sjames at gcc dot gnu.org
2024-06-15  1:03 ` sjames at gcc dot gnu.org
2024-06-15  1:06 ` pinskia at gcc dot gnu.org
2024-06-15  1:07 ` pinskia at gcc dot gnu.org
2024-06-21 22:42 ` andi-gcc at firstfloor dot 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).