gcc phi结构体
2015-06-30 18:06
375 查看
gcc phi结构体
phi是gcc中重要的数据结构类型,它主要用于ssa中的别名处理,本文主要讲述它的作用,相关数据结构体和核心处理函数
1.作用
phi主要用于别名处理,对于在ssa阶段中因为分支导致不确定具体是什么数据,采用phi.
2.主要数据结构
phi结点主要有三部分,def描述其ssa_name,表示其本身代表的数据,locus表示其位置,imm_use是一个双向链表结构,phi利用这个可以实现phi的def-use的遍历.
imm_use的结构:
可以把它理解为一个数据的def-use链接结构.其中use表示应用它的的tree,stmt,ssa_name表示本身的数据属性,prev,next表示双向链表.这个结构就是为了可以找到该数据def的use遍历.每个这个类型的数据其实就表示该定义数据的一个use结点.
常用的phi函数:
phi是gcc中重要的数据结构类型,它主要用于ssa中的别名处理,本文主要讲述它的作用,相关数据结构体和核心处理函数
1.作用
phi主要用于别名处理,对于在ssa阶段中因为分支导致不确定具体是什么数据,采用phi.
2.主要数据结构
struct GTY(()) phi_arg_d { /* imm_use MUST be the first element in struct because we do some pointer arithmetic with it. See phi_arg_index_from_use. */ struct ssa_use_operand_d imm_use; tree def; location_t locus; };
phi结点主要有三部分,def描述其ssa_name,表示其本身代表的数据,locus表示其位置,imm_use是一个双向链表结构,phi利用这个可以实现phi的def-use的遍历.
imm_use的结构:
typedef struct GTY(()) ssa_use_operand_d { struct ssa_use_operand_d* GTY((skip(""))) prev; struct ssa_use_operand_d* GTY((skip(""))) next; /* Immediate uses for a given SSA name are maintained as a cyclic list. To recognize the root of this list, the location field needs to point to the original SSA name. Since statements and SSA names are of different data types, we need this union. See the explanation in struct immediate_use_iterator_d. */ union { gimple stmt; tree ssa_name; } GTY((skip(""))) loc; tree *GTY((skip(""))) use; } ssa_use_operand_t;
可以把它理解为一个数据的def-use链接结构.其中use表示应用它的的tree,stmt,ssa_name表示本身的数据属性,prev,next表示双向链表.这个结构就是为了可以找到该数据def的use遍历.每个这个类型的数据其实就表示该定义数据的一个use结点.
常用的phi函数:
gimple_phi_num_args (const_gimple gs) gimple_phi_result (const_gimple gs) gimple_phi_set_result (gimple gs, tree result) gimple_phi_arg (gimple gs, unsigned index)
相关文章推荐
- iOS获取网络时间与转换格式
- [sersync] github镜像 二进制包
- Oracle 11g 新特性 --SQL Plan Management 说明
- [sersync] github镜像 二进制包
- 使用ViewFlipper实现屏幕滚动切换动画
- mysql5.6通过mysqldump自动备份
- PUUPLOAD 上传文件范例
- Ajax
- 关于apache以fastcgi模式运行php的错误理解纠正
- 磁悬浮科技产品
- 使用官方Fedora22 ISO镜像制作OpenStack云镜像
- MongoDB 安装
- 把图片生成Base64字符串
- WEB版一次选择多个文件进行批量上传(Plupload)的解决方案
- AMQP机制
- 磁悬浮技术 磁悬浮自行车
- 12个有趣的 XSS Vector
- 在Datagridview 控件DataGridViewComboBoxColumn怎么点两次才下拉下来
- 屏蔽DataGridView控件DataError 事件提示的异常信息
- block的实现原理