可以使用gcc --help=optimizers获取GCC / G ++中可用的优化器列表。 法律值和参数范围也在params.def定义。 是否有这样的命令和params.def文件也可用于clang?
It is possible to get the list of optimizers available in GCC/G++ with gcc --help=optimizers. The legal values and parameters range are also defined in params.def. Is there such a command and params.def file available for clang too?
最满意答案
1-对于Clang使用:
clang -OX -mllvm -debug-pass=Arguments foo.c其中X可以是Os,O1,O2,O3 and O4 (-O4相当于-O3,但当源文件中的编译目标文件发出LLVM IR而不是目标代码时,它执行LTO(链接时间优化)的事实除外)
您将拥有两组Pass Arguments ,其中第一组是global kernel传递,第二组是function pass 。
2-对于Opt使用:
llvm-as < /dev/null | opt -OX -disable-output -debug-pass=Arguments其中X可以是Os,O1,O2 and O3
1- For Clang use:
clang -OX -mllvm -debug-pass=Arguments foo.cwhere X can be Os,O1,O2,O3 and O4 (-O4 is equivalent to -O3 except the fact that it performs LTO (link time optimization) when compiled object files from source files emit LLVM IR instead of object code)
You will have two sets of Pass Arguments in which the first is the global kernel passes and the second is the function pass.
2- For Opt use:
llvm-as < /dev/null | opt -OX -disable-output -debug-pass=Argumentswhere X can be Os,O1,O2 and O3
更多推荐
发布评论