public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ubizjak at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/53346] [4.6/4.7/4.8 Regression] Bad vectorization in the proc cptrf2 of rnflow.f90
Date: Thu, 17 May 2012 18:35:00 -0000	[thread overview]
Message-ID: <bug-53346-4-3P6FhJDC10@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-53346-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53346

Uros Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-05-17
     Ever Confirmed|0                           |1

--- Comment #3 from Uros Bizjak <ubizjak at gmail dot com> 2012-05-17 18:29:12 UTC ---
Confirmed, -O2 vs. -O2 -ftree-vectorize on x86_64:

-O2 -ftree-vectorize:

Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total           
 time   seconds   seconds    calls   s/call   s/call  name    
 43.83      9.73     9.73       64     0.15     0.15  cptrf2_
 40.68     18.76     9.03     6685     0.00     0.00  trs2a2.2054
  7.70     20.47     1.71       64     0.03     0.03  gentrs_
  1.49     20.80     0.33       64     0.01     0.01  cptrf1_
  1.40     21.11     0.31        1     0.31    12.33  matsim_
  1.40     21.42     0.31     6685     0.00     0.00  invima.2045
  1.13     21.67     0.25       64     0.00     0.00  cmpcpt_

-O2:

Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total           
 time   seconds   seconds    calls   s/call   s/call  name    
 55.20      9.20     9.20     6685     0.00     0.00  trs2a2.2054
 23.40     13.10     3.90       64     0.06     0.06  cptrf2_
 10.38     14.83     1.73       64     0.03     0.03  gentrs_
  2.58     15.26     0.43       64     0.01     0.01  cptrf1_
  2.34     15.65     0.39     6685     0.00     0.00  invima.2045
  1.98     15.98     0.33        1     0.33     6.58  matsim_
  1.14     16.17     0.19       64     0.00     0.00  cmpcpt_

cptrf2_ runtime increased for almost 6 seconds!

The only vectorization is in:

3530: LOOP VECTORIZED.
rnflow.f90:3510: note: vectorized 1 loops in function.

Which corresponds to:

! ______________________________________________________________________
      real, dimension (1:nxtr), intent (in)     :: xxtrt ! extrema
      integer, intent (in)                      :: nxtr  ! leur nombre
      integer, dimension (1:nxtr), intent (out) :: ixtrt ! indices
      integer, intent (out)                     :: kerr  ! code d'erreur
! ______________________________________________________________________
!
      kerr = 0
      ixtrt = 0                  <<<<<<<<<<<<<< HERE

This vectorization results in zeroing of certain memory area:

    pxor    %xmm0, %xmm0
    leaq    (%rdx,%r8,4), %r8
    xorl    %esi, %esi
    .p2align 4,,10
    .p2align 3
.L183:
    addq    $1, %rsi
    movdqa    %xmm0, (%r8)
    addq    $16, %r8
    cmpq    %rsi, %r11
    ja    .L183

And this causes 6 second difference ?!


  parent reply	other threads:[~2012-05-17 18:35 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-14 15:44 [Bug tree-optimization/53346] New: " dominiq at lps dot ens.fr
2012-05-15  9:54 ` [Bug tree-optimization/53346] " rguenth at gcc dot gnu.org
2012-05-15 12:55 ` dominiq at lps dot ens.fr
2012-05-17 18:35 ` ubizjak at gmail dot com [this message]
2012-05-17 20:47 ` ubizjak at gmail dot com
2012-05-18 11:49 ` rguenth at gcc dot gnu.org
2012-05-18 14:28 ` rguenth at gcc dot gnu.org
2012-05-18 14:32 ` rguenth at gcc dot gnu.org
2012-05-18 14:49 ` ubizjak at gmail dot com
2012-05-18 14:52 ` dominiq at lps dot ens.fr
2012-05-18 15:13 ` ubizjak at gmail dot com
2012-05-18 17:32 ` ubizjak at gmail dot com
2012-05-18 17:34 ` ubizjak at gmail dot com
2012-05-18 17:46 ` ubizjak at gmail dot com
2012-05-18 17:48 ` ubizjak at gmail dot com
2012-05-18 17:56 ` pinskia at gcc dot gnu.org
2012-05-18 18:27 ` ubizjak at gmail dot com
2012-05-18 18:27 ` hjl.tools at gmail dot com
2012-05-18 19:45 ` dominiq at lps dot ens.fr
2012-05-19 23:50 ` dominiq at lps dot ens.fr
2012-09-07 11:59 ` [Bug target/53346] " rguenth at gcc dot gnu.org
2012-11-14 22:19 ` hubicka at gcc dot gnu.org
2012-11-14 22:38 ` hubicka at gcc dot gnu.org
2012-12-31  9:20 ` [Bug target/53346] [4.6/4.7/4.8 Regression] Bad if conversion in " pinskia at gcc dot gnu.org
2012-12-31  9:41 ` pinskia at gcc dot gnu.org
2022-09-26  3:22 ` cvs-commit at gcc dot gnu.org
2022-09-26  3:24 ` crazylht at gmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-53346-4-3P6FhJDC10@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).