各种编译器中的 Pragmas swp、ivdep、预取支持

问题描述 投票:0回答:1

在好的 Altix 手册(altix_single_cpu_optimization http://wwwuser.gwdg.de/~parallel/parallelrechner/altix_documentation/altix_single_cpu_optimization.pdf)中,我找到了用于优化编译器的编译提示列表

#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”

哪些编译器支持这些编译指示?什么实现了链接优化(软件流水线是低 ipc 和低寄存器计数处理器的相当困难的优化之一)?

c optimization c99 pragma
1个回答
3
投票

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, m.b. noswp 
#pragma rarely_called(funcs)
#pragma unroll (N)

英特尔 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(带有其他编译器的一堆或链接)

#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

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

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

克雷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]
© www.soinside.com 2019 - 2024. All rights reserved.