clang和llvm中可用的优化列表(List of optimizations available in clang and llvm opt)

编程入门 行业动态 更新时间:2024-10-28 19:19:05
clang和llvm中可用的优化列表(List of optimizations available in clang and llvm opt)

可以使用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.c

where 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=Arguments

where X can be Os,O1,O2 and O3

更多推荐

本文发布于:2023-07-29 18:52:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1318830.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:列表   llvm   clang   opt   optimizations

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!