请教专家们编写的C代码怎样利用编译器优化?为什么我选了-o3选项优化,但是发现时钟周期数几乎没有变化?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
对于大量计算的代码,尤其是for 循环比较多的情况,加上O3后一般会有一定提升,请确保你的测试方式正常。方便的话,可以把C文件和编译选项,以及.asm 文件发上来看看,你可以在编译选项中加上 -mw -k -s 获取软件流水相关信息