IR中设置指令的下一个节点

IR中设置指令的下一个节点

本文介绍了在LLVM IR中设置指令的下一个节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

1:%mul2 = fmul浮动%1,%1

1: %mul2 = fmul float %1, %1

2:%mul3 = fmul float%mul2,%1

2: %mul3 = fmul float %mul2, %1

3:%mul4 = fmul浮动%mul3,%1

3: %mul4 = fmul float %mul3, %1

4:%mul5 = fmul浮动%mul4,%1

4: %mul5 = fmul float %mul4, %1

5:%mul6 = fmul float%mul5,%1

5: %mul6 = fmul float %mul5, %1

6:%mul7 = fmul float%mul6,%1

6: %mul7 = fmul float %mul6, %1

7:存储浮点数%mul5,浮点数*%x,对齐4,!tbaa!0

7: store float %mul5, float* %x, align 4, !tbaa !0

我想将%mul5的下一个节点设置为%mul7.getNextNode()函数将下一个节点作为%mul6(我要删除).有功能吗?

I want to set the next node of %mul5 to %mul7. getNextNode() function gives the next node as %mul6(which I want to delete). Is there any function to do this?

推荐答案

getNextNode()是LLVM API中内部内容的内部实现详细信息.您永远不要使用它.您可以使用标准的LLVM API来操作指令列表:迭代器和IRBuilder.请参见 http://llvm.org/docs/ProgrammersManual.html#simplechanges 和 http://llvm.org/doxygen/classllvm_1_1IRBuilder.html .

getNextNode() is an internal implementation details of stuff deep inside LLVM API. You should never use it. You the standard LLVM API to manipulate the list of instructions: iterators and IRBuilder. See http://llvm.org/docs/ProgrammersManual.html#simplechanges and http://llvm.org/doxygen/classllvm_1_1IRBuilder.html for more information.

此外,在删除%mul6之前,您必须替换它的所有用法.

Also, before deleting %mul6 you have to replace all uses of it.

这篇关于在LLVM IR中设置指令的下一个节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 05:10