public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/95219] New: [11 Regression] FAIL: gcc.dg/vect/costmodel/x86_64/costmodel-pr30843.c
@ 2020-05-19 18:35 msebor at gcc dot gnu.org
  2020-05-20  6:36 ` [Bug target/95219] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: msebor at gcc dot gnu.org @ 2020-05-19 18:35 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95219
           Summary: [11 Regression] FAIL:
                    gcc.dg/vect/costmodel/x86_64/costmodel-pr30843.c
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: msebor at gcc dot gnu.org
  Target Milestone: ---

With yesterday's top of trunk I see the following test failure on x86_64-linux:

spawn -ignore SIGHUP /ssd/test/build/gcc-94923/gcc/xgcc
-B/ssd/test/build/gcc-94923/gcc/
/ssd/test/src/gcc/94923/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-pr30843.c
-fno-diagnostics-show-caret -fno-diagnostics-show-line-numbers
-fdiagnostics-color=never -fdiagnostics-urls=never -O2 -ftree-vectorize
-fvect-cost-model=dynamic -msse2 -fdump-tree-vect-details -S -o
costmodel-pr30843.s
PASS: gcc.dg/vect/costmodel/x86_64/costmodel-pr30843.c (test for excess errors)
gcc.dg/vect/costmodel/x86_64/costmodel-pr30843.c: pattern found 0 times
FAIL: gcc.dg/vect/costmodel/x86_64/costmodel-pr30843.c scan-tree-dump-times
vect "vectorization not profitable" 1

Also seen here:
https://gcc.gnu.org/pipermail/gcc-testresults/2020-May/561528.html

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

* [Bug target/95219] [11 Regression] FAIL: gcc.dg/vect/costmodel/x86_64/costmodel-pr30843.c
  2020-05-19 18:35 [Bug target/95219] New: [11 Regression] FAIL: gcc.dg/vect/costmodel/x86_64/costmodel-pr30843.c msebor at gcc dot gnu.org
@ 2020-05-20  6:36 ` rguenth at gcc dot gnu.org
  2020-05-20  6:42 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-05-20  6:36 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2020-05-20
     Ever confirmed|0                           |1
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org
   Target Milestone|---                         |11.0
             Status|UNCONFIRMED                 |ASSIGNED

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
I think this one is a bit older though (IIRC it was disabled before due to a
testsuite bug).  Vectorization _is_ clearly profitable - we're now using SLP
(possibly since that got induction support):

  Vector inside of loop cost: 24
  Vector prologue cost: 0
  Vector epilogue cost: 0
  Scalar iteration cost: 48
  Scalar outside cost: 0
  Vector outside cost: 0
  prologue iterations: 0
  epilogue iterations: 0
  Calculated minimum iters for profitability: 0

vectorized to

.L2:
        movdqa  %xmm0, %xmm4
        movdqa  %xmm1, %xmm3
        paddq   %xmm2, %xmm0
        addq    $32, %rdi
        movups  %xmm4, -32(%rdi)
        paddq   %xmm2, %xmm1
        movups  %xmm3, -16(%rdi)
        cmpq    %rdi, %rax
        jne     .L2

there's a missed optimization in that we choose two (identical) IVs for
the induction (late FRE is in "simple" mode and thus does not get rid of those
as equivalent) and that we have odd IVs (the extra moves), possibly
out-of-SSA cannot coalesce because of the constants:

  # vect_vec_iv_.7_1 = PHI <{ 0, 0 }(2), _19(3)>
  # vect_vec_iv_.8_18 = PHI <{ 0, 0 }(2), _17(3)>

and tricks maybe do not apply because of vector types.  I'll take this bug.

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

* [Bug target/95219] [11 Regression] FAIL: gcc.dg/vect/costmodel/x86_64/costmodel-pr30843.c
  2020-05-19 18:35 [Bug target/95219] New: [11 Regression] FAIL: gcc.dg/vect/costmodel/x86_64/costmodel-pr30843.c msebor at gcc dot gnu.org
  2020-05-20  6:36 ` [Bug target/95219] " rguenth at gcc dot gnu.org
@ 2020-05-20  6:42 ` rguenth at gcc dot gnu.org
  2020-05-20 12:06 ` cvs-commit at gcc dot gnu.org
  2020-05-20 12:06 ` rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-05-20  6:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Coalesce list: (4)ivtmp.15_4 & (22)ivtmp.15_22 [map: 2, 9] : Success -> 2
Coalesce list: (1)vect_vec_iv_.7_1 & (19)_19 [map: 0, 7] : Success -> 0
Coalesce list: (17)_17 & (18)vect_vec_iv_.8_18 [map: 5, 6] : Success -> 5
Coalesce list: (1)vect_vec_iv_.7_1 & (10)vect_vec_iv_.7_10 [map: 0, 4] : Fail
due to conflict
Coalesce list: (2)vect_vec_iv_.8_2 & (18)_17 [map: 1, 5] : Fail due to conflict
Coalesce list: (4)ivtmp.15_4 & (21)ivtmp.15_21 [map: 2, 8] : Success -> 2

;;   basic block 2, loop depth 0
;;    pred:       ENTRY
  ivtmp.15_21 = (unsigned long) pBuffer_5(D);
  _12 = ivtmp.15_21 + 8192;
;;    succ:       3

;;   basic block 3, loop depth 1
;;    pred:       2
;;                3
  # vect_vec_iv_.7_1 = PHI <{ 0, 0 }(2), _19(3)>
  # vect_vec_iv_.8_18 = PHI <{ 0, 0 }(2), _17(3)>
  # ivtmp.15_4 = PHI <ivtmp.15_21(2), ivtmp.15_22(3)>
  vect_vec_iv_.7_10 = vect_vec_iv_.7_1;
  _19 = vect_vec_iv_.7_1 + { 16843009, 16843009 };
  vect_vec_iv_.8_2 = vect_vec_iv_.8_18;
  _17 = vect_vec_iv_.8_18 + { 16843009, 16843009 };
  _20 = (void *) ivtmp.15_4;
  MEM[base: _20, offset: 0B] = vect_vec_iv_.7_10;
  MEM[base: _20, offset: 16B] = vect_vec_iv_.8_2;
  ivtmp.15_22 = ivtmp.15_4 + 32;
  if (_12 != ivtmp.15_22)
    goto <bb 3>; [99.00%]
  else
    goto <bb 4>; [1.00%]
;;    succ:       3
;;                4

ah, so coalescing is hindered by "scheduling" here.  -fschedule-insns
gets rid of one of the copies.

Not vectorized code looks like

.L2:
        movq    %rax, (%rdi)
        addq    $32, %rdi
        movq    %rax, -24(%rdi)
        movq    %rax, -16(%rdi)
        movq    %rax, -8(%rdi)
        addq    $16843009, %rax
        cmpq    %rdx, %rax
        jne     .L2

btw. which is likely slower (so the testcase itself is easy to fix).

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

* [Bug target/95219] [11 Regression] FAIL: gcc.dg/vect/costmodel/x86_64/costmodel-pr30843.c
  2020-05-19 18:35 [Bug target/95219] New: [11 Regression] FAIL: gcc.dg/vect/costmodel/x86_64/costmodel-pr30843.c msebor at gcc dot gnu.org
  2020-05-20  6:36 ` [Bug target/95219] " rguenth at gcc dot gnu.org
  2020-05-20  6:42 ` rguenth at gcc dot gnu.org
@ 2020-05-20 12:06 ` cvs-commit at gcc dot gnu.org
  2020-05-20 12:06 ` rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-05-20 12:06 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:b2f26af32b5b031fce761aa090de9476a53e6e5a

commit r11-519-gb2f26af32b5b031fce761aa090de9476a53e6e5a
Author: Richard Biener <rguenther@suse.de>
Date:   Wed May 20 09:22:58 2020 +0200

    tree-optimization/95219 - improve IV selection for induction

    This improves code generation with SSE2 for the testcase by
    making sure to only generate a single IV when the group size
    is a multiple of the vector size.  It also adjusts the testcase
    which was passing before.

    2020-05-20  Richard Biener  <rguenther@suse.de>

            PR tree-optimization/95219
            * tree-vect-loop.c (vectorizable_induction): Reduce
            group_size before computing the number of required IVs.

            * gcc.dg/vect/costmodel/x86_64/costmodel-pr30843.c: Adjust.

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

* [Bug target/95219] [11 Regression] FAIL: gcc.dg/vect/costmodel/x86_64/costmodel-pr30843.c
  2020-05-19 18:35 [Bug target/95219] New: [11 Regression] FAIL: gcc.dg/vect/costmodel/x86_64/costmodel-pr30843.c msebor at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2020-05-20 12:06 ` cvs-commit at gcc dot gnu.org
@ 2020-05-20 12:06 ` rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-05-20 12:06 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2020-05-20 12:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-19 18:35 [Bug target/95219] New: [11 Regression] FAIL: gcc.dg/vect/costmodel/x86_64/costmodel-pr30843.c msebor at gcc dot gnu.org
2020-05-20  6:36 ` [Bug target/95219] " rguenth at gcc dot gnu.org
2020-05-20  6:42 ` rguenth at gcc dot gnu.org
2020-05-20 12:06 ` cvs-commit at gcc dot gnu.org
2020-05-20 12:06 ` 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).