我测试和优化与英特尔Fortran 15的遗留代码,我有这个简单的循环:
do ir=1,N(lev)
G1(lev)%D(ir) = 0.d0
G2(lev)%D(ir) = 0.d0
enddo
其中lev
等于某个整数。
结构和索引对于编译器相当复杂,但它可以在任务成功,因为我可以在其他线路看。 现在,上面的循环,我得到这个从报告汇编:
LOOP BEGIN at MLFMATranslationProd.f90(38,2)
remark #15399: vectorization support: unroll factor set to 4
remark #15300: LOOP WAS VECTORIZED
remark #15462: unmasked indexed (or gather) loads: 2
remark #15475: --- begin vector loop cost summary ---
remark #15476: scalar loop cost: 12
remark #15477: vector loop cost: 20.000
remark #15478: estimated potential speedup: 2.340
remark #15479: lightweight vector operations: 5
remark #15481: heavy-overhead vector operations: 1
remark #15488: --- end vector loop cost summary ---
LOOP END
我的问题是:它是如何的矢量循环成本比标一个更高? 我能做些什么去实现的estimated potential speedup
?