如何确定`phinode'是否受``if`分支的影响

发布于 2025-01-26 05:30:11 字数 512 浏览 1 评论 0原文

llvm中,phinode在无法静态确定变量分配时发生。当phinode发生时,我想如果phinode中的分配是由给定的分支确定的。在下面的三个示例中,前两个中x的值取决于config的值,但第三个示例没有。

在此处描述“

使用phinode-> getIncomingBlock(i)可以获取i phinode的基本块。问题是:边缘是否暗示“传入”必须是CFG的边缘?或者它可能是纯粹的新边缘。

谢谢!

In llvm, a PHINode occurs when a variable assignment can not be determined statically. When PHINode occurs, I want to if the assignment in the PHINode is determined by a given if branch. For the three example below, the value of x in the first two is control-dependence on the value of config, but the third example does not.

enter image description here

Extended question

using PHINode->getIncomingBlock(i) can get the ith incoming basic block of the PHINode. The question is: does the edge imply by "incoming" must be an edge in CFG? or it may be a pure new edge.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一杯敬自由 2025-02-02 05:30:11

我当前版本的规则:

there exist a successor of “if(config)” that dominate 
at least one but not all predecessors of PHI-instruction

My current version of rule:

there exist a successor of “if(config)” that dominate 
at least one but not all predecessors of PHI-instruction
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文