gpt4 book ai didi

c++ - 你能从 LLVM pass 调用 pass 吗?

转载 作者:太空宇宙 更新时间:2023-11-04 04:00:49 28 4
gpt4 key购买 nike

我正在编写自己的 LLVM pass,它修改了 LLVM 位码。在生成位码时,我想禁用函数内联,但是当我完成对位码的修改后,我想调用执行函数内联的传递。这个可以吗。如果是,如何?

为了更好地理解我在说什么,请看下面的代码。

bool MyBitCodeModifier::runOnModule(Module &M)
{
// Here is the code of my pass which modifies bitcode
// I need to call inline pass here
}

最佳答案

对于内联,您不需要调用传递。请改用 InlineFunction。您可以在 include/llvm/Transforms/Utils/Cloning.h 中找到定义。

但是如果你坚持在你的之后调用内联传递,你可以修改 PassManager 以按你想要的顺序运行传递。

关于c++ - 你能从 LLVM pass 调用 pass 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11781438/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com