public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
* how to disable vectorization
@ 2015-11-14 21:33 Tim Prince
  2015-11-14 22:00 ` Tobias Burnus
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Tim Prince @ 2015-11-14 21:33 UTC (permalink / raw)
  To: fortran

Now that gfortran 6.0 has become aggressive enough on vectorization to
reduce performance in some cases, is there an equivalent to:
gcc (by function): __attribute__((optimize("no-tree-vectorize")))
or ifort (by DO loop) !dir$ novector ?

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

* Re: how to disable vectorization
  2015-11-14 21:33 how to disable vectorization Tim Prince
@ 2015-11-14 22:00 ` Tobias Burnus
  2015-11-15  1:34   ` Tim Prince
  2015-11-14 22:05 ` Steve Kargl
  2015-11-15  7:44 ` Richard Biener
  2 siblings, 1 reply; 6+ messages in thread
From: Tobias Burnus @ 2015-11-14 22:00 UTC (permalink / raw)
  To: Tim Prince, fortran

Tim Prince wrote:
> Now that gfortran 6.0 has become aggressive enough on vectorization to
> reduce performance in some cases, is there an equivalent to:
> gcc (by function): __attribute__((optimize("no-tree-vectorize")))
> or ifort (by DO loop) !dir$ novector ?

I think there isn't but I wonder whether the OpenMP's "!$omp simd 
savelen(1)" directive is able to do this.

  (Requires -fopenmp-simd or -fopenmp, the former only enables the SIMD 
directives, ignoring other OpenMP directives, without linking libgomp 
and without  implying -frecursive.)

Cheers,

Tobias


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

* Re: how to disable vectorization
  2015-11-14 21:33 how to disable vectorization Tim Prince
  2015-11-14 22:00 ` Tobias Burnus
@ 2015-11-14 22:05 ` Steve Kargl
  2015-11-15  7:44 ` Richard Biener
  2 siblings, 0 replies; 6+ messages in thread
From: Steve Kargl @ 2015-11-14 22:05 UTC (permalink / raw)
  To: Tim Prince; +Cc: fortran

On Sat, Nov 14, 2015 at 04:33:27PM -0500, Tim Prince wrote:
> Now that gfortran 6.0 has become aggressive enough on vectorization to
> reduce performance in some cases, is there an equivalent to:
> gcc (by function): __attribute__((optimize("no-tree-vectorize")))
> or ifort (by DO loop) !dir$ novector ?

No.

There is -fno-tree-vectorize.

-- 
Steve

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

* Re: how to disable vectorization
  2015-11-14 22:00 ` Tobias Burnus
@ 2015-11-15  1:34   ` Tim Prince
  0 siblings, 0 replies; 6+ messages in thread
From: Tim Prince @ 2015-11-15  1:34 UTC (permalink / raw)
  To: fortran



On 11/14/2015 5:00 PM, Tobias Burnus wrote:
> Tim Prince wrote:
>> Now that gfortran 6.0 has become aggressive enough on vectorization to
>> reduce performance in some cases, is there an equivalent to:
>> gcc (by function): __attribute__((optimize("no-tree-vectorize")))
>> or ifort (by DO loop) !dir$ novector ?
>
> I think there isn't but I wonder whether the OpenMP's "!$omp simd
> savelen(1)" directive is able to do this.
>
>  (Requires -fopenmp-simd or -fopenmp, the former only enables the SIMD
> directives, ignoring other OpenMP directives, without linking libgomp
> and without  implying -frecursive.)
>
> Cheers,
>
> Tobias
>
>
This works for a DO loop (allowing a compiler targeting Xeon Phi to
optimize):

#ifndef __MIC__
!$omp simd safelen(1)
#endif

leaving no way to control the optimization under f90 array assignment. 
This makes 14 omp simd loops, along with 17 omp parallel regions, in my
benchmark.
I brought up omp simd safelen last month when rehearsing for my Intel
sponsored webinar and it was the first time they had seen an example of
it; now you've pointed out another use.  It would also reconcile the C
source code between Intel and gnu compilers.

Thanks,

-- 
Tim Prince

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

* Re: how to disable vectorization
  2015-11-14 21:33 how to disable vectorization Tim Prince
  2015-11-14 22:00 ` Tobias Burnus
  2015-11-14 22:05 ` Steve Kargl
@ 2015-11-15  7:44 ` Richard Biener
  2015-11-15 12:34   ` Tim Prince
  2 siblings, 1 reply; 6+ messages in thread
From: Richard Biener @ 2015-11-15  7:44 UTC (permalink / raw)
  To: Tim Prince, fortran

On November 14, 2015 10:33:27 PM GMT+01:00, Tim Prince <tprince818.tp@gmail.com> wrote:
>Now that gfortran 6.0 has become aggressive enough on vectorization to
>reduce performance in some cases, is there an equivalent to:
>gcc (by function): __attribute__((optimize("no-tree-vectorize")))
>or ifort (by DO loop) !dir$ novector ?

I'd be interested in such cases.  Can you file a bugreport please?

Richard.


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

* Re: how to disable vectorization
  2015-11-15  7:44 ` Richard Biener
@ 2015-11-15 12:34   ` Tim Prince
  0 siblings, 0 replies; 6+ messages in thread
From: Tim Prince @ 2015-11-15 12:34 UTC (permalink / raw)
  To: fortran



On 11/15/2015 2:44 AM, Richard Biener wrote:
> On November 14, 2015 10:33:27 PM GMT+01:00, Tim Prince <tprince818.tp@gmail.com> wrote:
>> Now that gfortran 6.0 has become aggressive enough on vectorization to
>> reduce performance in some cases, is there an equivalent to:
>> gcc (by function): __attribute__((optimize("no-tree-vectorize")))
>> or ifort (by DO loop) !dir$ novector ?
> I'd be interested in such cases.  Can you file a bugreport please?
>
> Richard.
>
>
The need for pragma to prevent vectorization (with ifdef guard to allow
it for Intel Xeon Phi) has been more pervasive in the past with Intel
compilers.  Recent Intel Fortran has improved its cost model so as to
make the right decision more consistently, but Intel C++ requires it inn
the same cases as the recent g++/gfortran update.   I will first work to
reconcile my test suite with the omp simd safelen(1) then I will post on
bugzilla.

Thanks,

-- 
Tim Prince

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

end of thread, other threads:[~2015-11-15 12:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-14 21:33 how to disable vectorization Tim Prince
2015-11-14 22:00 ` Tobias Burnus
2015-11-15  1:34   ` Tim Prince
2015-11-14 22:05 ` Steve Kargl
2015-11-15  7:44 ` Richard Biener
2015-11-15 12:34   ` Tim Prince

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).