2
我试图选择性地展开第二循环在下面的程序:循环展开在铛
#include <stdio.h>
int main()
{
int in[1000], out[1000];
int i,j;
#pragma nounroll
for (i = 100; i < 1000; i++)
{
in[i]+= 10;
}
#pragma unroll 2
for (j = 100; j < 1000; j++)
{
out[j]+= 10;
}
return 1;
}
当我用下面的选项运行铛(3.5),这解开两个环的4倍。
clang -std=c++11 -O3 -fno-slp-vectorize -fno-vectorize -mllvm -unroll-count=4 -mllvm -debug-pass=Arguments -emit-llvm -c *.cpp
我在做什么错?另外,如果我添加-fno-unroll-loops
或跳过-unroll-count=4
标志,它不会展开任何循环。
另外,有关如何调试编译指示错误的提示?