Pragmas swp, ivdep, support for prefetching in various compilers

In a good Altix manual (altix_single_cpu_optimization http://wwwuser.gwdg.de/~parallel/parallelrechner/altix_documentation/altix_single_cpu_optimization.pdf ) I found this list of pragma tips for optimizing compilers

#pragma ivdep // no aliasing #pragma swp // try to software-pipeline #pragma noswp // disable software-pipelining #pragma loop count (NN) // hint for SWP #pragma distribute point // split this large loop #pragma unroll (n) // unroll n times #pragma nounroll // do not unroll #pragma prefetch a // prefetch array "a" #pragma noprefetch c // do not prefetch array "c" 

What compilers support these pragmas? And what implements related optimizations (pipeline processing of software is one of the rather tough optimizations for processors with a low number of ipc and low reg processors)?

+4
source share
1 answer

Sun Studio 12 http://docs.oracle.com/cd/E19205-01/819-5265/bjaby/index.html

 #pragma nomemorydepend #pragma no_side_effect (funcs) #pragma opt N (funcs) #pragma pipeloop(n) // like swp, mb noswp #pragma rarely_called(funcs) #pragma unroll (N) 

Intel http://software.intel.com/en-us/articles/use-pragmas-with-the-intel-c-compiler-for-linux-on-64-bit-architecture/

  #pragma swp #pragma noswp #pragma unroll #pragma distribute point #pragma prefetch *arrays* #pragma loop count #pragma ivdep 

IBM http://publib.boulder.ibm.com/infocenter/comphelp/v7v91/topic/com.ibm.vacpp7a.doc/compiler/ref/rupragen.htm

 #pragma block_loop #pragma disjoint #pragma execution_frequency #pragma isolated_call #pragma stream_unroll #pragma unroll #pragma unrollandfuse 

Open64 http://wiki.open64.net/index.php/Pragmas_Support_in_Open64 (with a bundle or links to other compilers)

 #pragma unroll #pragma blockable #pragma prefetch #pragma ivdep 

PGI 9 http://www.math.hkbu.edu.hk/parallel/pgi/doc/pgiws_ug/pgi32u10.htm

 #pragma depchk #pragma opt #pragma unroll #pragma vector 

MSvs2003 http://msdn.microsoft.com/en-us/library/d9x1s805(VS.71).aspx

 #pragma optimize 

HP http://www.docs.hp.com/en/B3901-90024/ch03s06.html

 #pragma if_convert #pragma rarely_called #pragma unroll // or unroll factor 

CRAY http://docs.cray.com/books/004-2179-001/html-004-2179-001/xgaslrwh.html

 #pragma _CRI ivdep #pragma _CRI opt // or noopt #pragma _CRI novector // novsearch #pragma _CRI shortloop #pragma _CRI prefervector #pragma _CRI split #pragma _CRI unroll [n] 
+3
source

Source: https://habr.com/ru/post/1307896/


All Articles