public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/49513] New: introducing a product inhibit vectorization
@ 2011-06-23  6:55 vincenzo.innocente at cern dot ch
  2011-06-23 11:55 ` [Bug tree-optimization/49513] PRE inhibits if-conversion and vectorization rguenth at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: vincenzo.innocente at cern dot ch @ 2011-06-23  6:55 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: introducing a product inhibit vectorization
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: vincenzo.innocente@cern.ch


in the simple example below the first loop vectorize, the second not
I'm using
gcc version 4.7.0 20110528 (experimental) (GCC) 

#include<cmath>
float __attribute__ ((aligned(16))) a[1024];
float __attribute__ ((aligned(16))) s[1024];
float __attribute__ ((aligned(16))) c[1024];


inline float bar(float y, float x ){
  float xx = fabs(x);
  float yy = fabs(y);

  float tmp =0.0f;
  if (yy>xx) {
    tmp = yy;
    yy=xx; xx=tmp;
  }
  float t=yy/xx;
  return t;
}

void foo1() {
  for (int i=0; i!=1024; ++i) {
    float z = i;
    a[i] = bar(s[i],c[i]);  
  }
}
void foo2() {
  for (int i=0; i!=1024; ++i) {
    float z = i;
    a[i] = bar(z*s[i],z*c[i]);  
 }
}



c++   -std=c++0x -Ofast -c vectBug.cc -ftree-vectorizer-verbose=7

vectBug.cc:21: note: vect_model_load_cost: aligned.
vectBug.cc:21: note: vect_get_data_access_cost: inside_cost = 1, outside_cost =
0.
vectBug.cc:21: note: vect_model_load_cost: aligned.
vectBug.cc:21: note: vect_get_data_access_cost: inside_cost = 2, outside_cost =
0.
vectBug.cc:21: note: vect_model_store_cost: aligned.
vectBug.cc:21: note: vect_get_data_access_cost: inside_cost = 3, outside_cost =
0.
vectBug.cc:21: note: vect_model_load_cost: aligned.
vectBug.cc:21: note: vect_model_load_cost: inside_cost = 1, outside_cost = 0 .
vectBug.cc:21: note: vect_model_load_cost: aligned.
vectBug.cc:21: note: vect_model_load_cost: inside_cost = 1, outside_cost = 0 .
vectBug.cc:21: note: vect_model_simple_cost: inside_cost = 1, outside_cost = 0
.
vectBug.cc:21: note: vect_model_simple_cost: inside_cost = 1, outside_cost = 0
.
vectBug.cc:21: note: vect_model_simple_cost: inside_cost = 1, outside_cost = 0
.
vectBug.cc:21: note: vect_model_store_cost: aligned.
vectBug.cc:21: note: vect_model_store_cost: inside_cost = 1, outside_cost = 0 .
vectBug.cc:21: note: Cost model analysis: 
  Vector inside of loop cost: 6
  Vector outside of loop cost: 0
  Scalar iteration cost: 8
  Scalar outside cost: 0
  prologue iterations: 0
  epilogue iterations: 0
  Calculated minimum iters for profitability: 1

vectBug.cc:21: note:   Profitability threshold = 3

vectBug.cc:21: note: LOOP VECTORIZED.
vectBug.cc:20: note: vectorized 1 loops in function.

vectBug.cc:27: note: not vectorized: control flow in loop.
vectBug.cc:26: note: vectorized 0 loops in function.


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

end of thread, other threads:[~2023-05-02  0:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-23  6:55 [Bug tree-optimization/49513] New: introducing a product inhibit vectorization vincenzo.innocente at cern dot ch
2011-06-23 11:55 ` [Bug tree-optimization/49513] PRE inhibits if-conversion and vectorization rguenth at gcc dot gnu.org
2011-06-23 12:17 ` vincenzo.innocente at cern dot ch
2011-06-23 12:59 ` [Bug tree-optimization/49513] DOM " rguenth at gcc dot gnu.org
2011-07-08 21:12 ` law at redhat dot com
2023-05-02  0:46 ` pinskia 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).