儿童便秘吃什么最管用| 2.16什么星座| 为什么男怕招风耳| 梦见谈恋爱很甜蜜是什么意思| 没有什么会永垂不朽| 迷瞪是什么意思| 支原体衣原体是什么病| 儿加一笔是什么字| 新生儿老是打嗝是什么原因| 晚上吃什么好| 牛逼是什么意思| 疮痈是什么意思| 来字五行属什么| 桑黄长在什么树上| 通奸是什么意思| 陈百强属什么生肖| 舌头白腻厚苔是什么原因| 血热吃什么药| 颜文字是什么意思| 性生活过后出血是什么原因| 鸡眼长什么样子| 伸筋草长什么样子| 挫是什么意思| 血清铁是什么意思| 机票什么时候买最便宜| 金鸡报晓是什么意思| 皮肤瘙痒用什么药最好| 荨麻疹是什么引起| 米诺地尔搽剂和米诺地尔酊有什么区别| 葛根是什么| 什么是角| 脸上涂什么可以美白| mac是什么意思啊| 胎儿双侧肾盂无分离是什么意思| 拉肚子能吃什么| 天蝎座男生喜欢什么样的女生| 福建有什么好吃的| 二甲双胍为什么晚上吃| pin是什么意思啊| 8月8号什么星座| 积德是什么意思| 伤口用什么消毒| 录取线差是什么意思| g6pd筛查是检查什么| 女生私处长什么样| 血红蛋白偏低的原因和危害是什么| 秋天有什么特点| 冬至吃什么| 8月26日什么星座| 阴历三月是什么星座| 1982属什么生肖| dvf是什么品牌| 大便颜色发绿是什么原因| 天体是什么| 诺氟沙星胶囊治什么病| 胃痛吃什么| 仓鼠喜欢吃什么| 高血压头晕吃什么药| 米线是什么材料做的| charleskeith什么牌子| 男性前列腺炎有什么症状| 高度鳞状上皮内病变是什么意思| 韭菜苔炒什么好吃| 长史相当于现在什么官| cnb是什么意思| 牙疼不能吃什么| 神经性皮炎用什么药膏效果最好| 手链突然断了预示什么| 肚子一直咕咕叫是什么原因| 天方夜谭是什么意思| 易栓症是什么病| 碱性磷酸酶偏高是什么原因| 罗布麻是什么东西| 11月2日什么星座| π是什么意思| 713是什么星座| 知我者非你也什么意思| 宫颈柱状上皮异位是什么意思| 小日子是什么意思| 咳嗽有黄痰是什么原因| girls是什么意思| 7月15是什么节日| 10月12号是什么星座| 梦见卖东西是什么意思| 做肝功能检查挂什么科| 雪纳瑞什么颜色最贵| 儿女情长英雄气短是什么意思| 乌龙茶属于什么茶| 有趣的灵魂是什么意思| 岗位性质指的是什么| 组织机构代码是什么| 什么是ntr| 生活因什么而精彩| 老枞水仙属于什么茶| 康波是什么意思| 初级会计什么时候拿证| 粉红粉红的什么填空| 友人是什么意思| 男人要吃什么才能壮阳| 女性盆腔炎什么症状| 什么的树丛| 湿疹是什么| 腹部彩超挂什么科| 0到3个月的婴儿惊吓吃什么药| 偏光眼镜是什么意思| 孕妇吸二手烟对胎儿有什么影响| 药占比什么意思| 一热就头疼是什么原因| 1993年什么命| 广州白云区有什么好玩的地方| 剑桥英语和新概念英语有什么区别| 煮玉米放什么好吃| 双修是什么意思| 香辛料是什么| 一片哗然是什么意思| 6月30号是什么星座| 九个口是什么字| 嗓子有点疼吃什么药| 真谛是什么意思| 小孩儿咳嗽有什么妙招| 为什么老被蚊子咬| 置之死地而后生是什么意思| 三轮体空是什么意思| 梅兰竹菊代表什么生肖| 甲不开仓财物耗散是什么意思| 沉珂是什么意思| 血糖高适合喝什么茶| 心脏供血不足吃什么药好| 纳甲是什么意思| 手足口病吃什么药| 廉价什么意思| 伶牙俐齿是什么生肖| 上火吃什么| 小儿支气管炎咳嗽吃什么药好得快| 红薯叶不能和什么一起吃| 喝什么茶减肥| 拔腋毛有什么危害| 青稞面是什么| 每逢佳节倍思亲的上一句是什么| 山药与什么食物相克| 南非叶有什么功效| 乐可是什么| 肌腱是什么组织| 尿酸高去医院挂什么科| 乏力没精神容易疲劳是什么原因| 维生素b12有什么作用| 女人吃什么排卵最快| 打嗝放屁多是什么原因| 女人眉心有痣代表什么| 20岁长白头发是什么原因造成的| 拿铁咖啡什么意思| 月经不来挂什么科| 蓝色配什么裤子| 精力是什么意思| 荨麻疹吃什么药好的快| 眼睛痒什么原因| 大小休是什么意思| 掉头发吃什么药| 爱心是什么牌子| 身体水肿是什么原因引起的| 女人吃什么能增加雌激素| 琥珀是什么颜色| 为什么早上起来恶心想吐| 茵是什么意思| 巨大的什么| 贪心不足蛇吞象什么意思| 驻马店有什么大学| 西瓜禁忌和什么一起吃| 好运连连是什么意思| 急性阑尾炎什么症状| 老人吃什么水果对身体好| 磨玻璃结节影是什么意思| 梦到跟人吵架是什么意思| 小名是什么意思| 吃什么能减肥最快还能减全身| 再接再厉后面接什么好| 属兔生什么属相宝宝好| 5点至7点是什么时辰| 苏轼是什么朝代的| 茶水洗脸有什么好处和坏处| 鼻窦在什么位置图片| 咳嗽有痰挂什么科| 女人梦到被蛇咬是什么意思| 你什么我什么成语| 膝盖积液挂什么科| 孕妇梦见洪水是什么意思| 女人吃什么提高性激素| 血小板体积偏低是什么原因| 梦到和别人吵架是什么意思| aml是什么意思| 什么是耽美| 老是觉得口渴是什么原因引起的| 骨瘤是什么病| 牙齿酸是什么原因| 贫血喝什么口服液最好| 菊花泡水喝有什么好处| 烟雾病是什么原因引起的| 冲锋衣三合一是什么意思| 过去的日子叫什么日| 直肠癌是什么症状| 陌上花是什么意思| 乙基麦芽酚是什么| 为道日损什么意思| 份量是什么意思| 落寞是什么意思| 多糖是什么| 米索前列醇片是什么药| 地瓜是什么| 一个尔一个玉念什么| 为什么遗精| crpa是什么细菌| 黄瓜为什么会发苦| 明年是什么年啊| 梦见自己疯了什么意思| 肌醇是什么东西| 西瓜有什么功效和作用| 早期肠癌有什么症状| 圆脸适合什么短发发型| 送什么生日礼物给妈妈| 血糖高有什么表现| 子宫和宫颈有什么区别| 小蓝片是什么| 44岁月经量少是什么原因| 尿血是什么病的征兆| 痛风什么症状| 打喷嚏是什么意思| 桂花什么时候开| 一直打嗝什么原因| h是什么牌子的皮带| 霸王龙的后代是什么| 心脏彩超能检查出什么| 种牙好还是镶牙好区别是什么| 什么药可以溶解血栓| 栓剂是什么| 玉的五行属性是什么| 小孩牙疼吃什么药| dfs是什么| 中的反义词是什么| 天煞孤星是什么意思| 2月2日什么星座| 乔迁礼物应该送什么| 舍本逐末什么意思| 羿字五行属什么| 输钾为什么会痛| 骤雨落宿命敲什么意思| 白细胞阳性是什么意思| 壮志凌云是什么生肖| 附属国是什么意思| 2015年属什么生肖| us是什么单位| 睾丸痒是什么原因| 孢子粉是什么| 牙髓炎吃什么药| 什么洗发水去屑效果好| 玉米须加什么治痛风| 多动症是什么引起的| 烦请是什么意思| 720是什么意思| 为什么佛山有三个车牌| 尿酸降低是什么意思| 甘油三酯是指什么| 身体肿是什么原因引起的| 胃酸吃什么可以缓解| 前列腺增生吃什么药见效快| 百度Jump to content

工行承德分行“三个推进”促服务水平不断提升

From Wikipedia, the free encyclopedia
Some CFG examples:
(a) an if-then-else
(b) a while loop
(c) a natural loop with two exits, e.g. while with an if...break in the middle; non-structured but reducible
(d) an irreducible CFG: a loop with two entry points, e.g. goto into a while or for loop
A control-flow graph used by the Rust compiler to perform codegen.
百度 要紧密结合我省开展的法治建设年活动,切实增强宪法意识、法治意识,带头尊法学法守法用法,严格依法履行司法职责。

In computer science, a control-flow graph (CFG) is a representation, using graph notation, of all paths that might be traversed through a program during its execution. The control-flow graph was conceived by Frances E. Allen,[1] who noted that Reese T. Prosser used boolean connectivity matrices for flow analysis before.[2]

The CFG is essential to many compiler optimizations and static-analysis tools.

Definition

[edit]

In a control-flow graph each node in the graph represents a basic block, i.e. a straight-line sequence of code with a single entry point and a single exit point, where no branches or jumps occur within the block. Basic blocks start with jump targets and end with jumps or branch instructions. Directed edges are used to represent jumps in the control flow. There are, in most presentations, two specially designated blocks: the entry block, through which control enters into the flow graph, and the exit block, through which all control flow leaves.[3]

Because of its construction procedure, in a CFG, every edge A→B has the property that:

outdegree(A) > 1 or indegree(B) > 1 (or both).[4]

The CFG can thus be obtained, at least conceptually, by starting from the program's (full) flow graph—i.e. the graph in which every node represents an individual instruction—and performing an edge contraction for every edge that falsifies the predicate above, i.e. contracting every edge whose source has a single exit and whose destination has a single entry. This contraction-based algorithm is of no practical importance, except as a visualization aid for understanding the CFG construction, because the CFG can be more efficiently constructed directly from the program by scanning it for basic blocks.[4]

Example

[edit]

Consider the following fragment of code:

0: (A) t0 = read_num
1: (A) if t0 mod 2 == 0
2: (B)     print t0 + " is even."
3: (B)     goto 5
4: (C) print t0 + " is odd."
5: (D) end program

In the above, we have 4 basic blocks: A from 0 to 1, B from 2 to 3, C at 4 and D at 5. In particular, in this case, A is the "entry block", D the "exit block" and lines 4 and 5 are jump targets. A graph for this fragment has edges from A to B, A to C, B to D and C to D.

Reachability

[edit]

Reachability is a graph property useful in optimization.

If a subgraph is not connected from the subgraph containing the entry block, that subgraph is unreachable during any execution, and so is unreachable code; under normal conditions it can be safely removed.

If the exit block is unreachable from the entry block, an infinite loop may exist. Not all infinite loops are detectable, see Halting problem. A halting order may also exist there.

Unreachable code and infinite loops are possible even if the programmer does not explicitly code them: optimizations like constant propagation and constant folding followed by jump threading can collapse multiple basic blocks into one, cause edges to be removed from a CFG, etc., thus possibly disconnecting parts of the graph.

Domination relationship

[edit]

A block M dominates a block N if every path from the entry that reaches block N has to pass through block M. The entry block dominates all blocks.

In the reverse direction, block M postdominates block N if every path from N to the exit has to pass through block M. The exit block postdominates all blocks.

It is said that a block M immediately dominates block N if M dominates N, and there is no intervening block P such that M dominates P and P dominates N. In other words, M is the last dominator on all paths from entry to N. Each block has a unique immediate dominator.

Similarly, there is a notion of immediate postdominator, analogous to immediate dominator.

The dominator tree is an ancillary data structure depicting the dominator relationships. There is an arc from Block M to Block N if M is an immediate dominator of N. This graph is a tree, since each block has a unique immediate dominator. This tree is rooted at the entry block. The dominator tree can be calculated efficiently using Lengauer–Tarjan's algorithm.

A postdominator tree is analogous to the dominator tree. This tree is rooted at the exit block.

Special edges

[edit]

A back edge is an edge that points to a block that has already been met during a depth-first (DFS) traversal of the graph. Back edges are typical of loops.

A critical edge is an edge which is neither the only edge leaving its source block, nor the only edge entering its destination block. These edges must be split: a new block must be created in the middle of the edge, in order to insert computations on the edge without affecting any other edges.

An abnormal edge is an edge whose destination is unknown. Exception handling constructs can produce them. These edges tend to inhibit optimization.

An impossible edge (also known as a fake edge) is an edge which has been added to the graph solely to preserve the property that the exit block postdominates all blocks. It cannot ever be traversed.

Loop management

[edit]

A loop header (sometimes called the entry point of the loop) is a dominator that is the target of a loop-forming back edge. The loop header dominates all blocks in the loop body. A block may be a loop header for more than one loop. A loop may have multiple entry points, in which case it has no "loop header".

Suppose block M is a dominator with several incoming edges, some of them being back edges (so M is a loop header). It is advantageous to several optimization passes to break M up into two blocks Mpre and Mloop. The contents of M and back edges are moved to Mloop, the rest of the edges are moved to point into Mpre, and a new edge from Mpre to Mloop is inserted (so that Mpre is the immediate dominator of Mloop). In the beginning, Mpre would be empty, but passes like loop-invariant code motion could populate it. Mpre is called the loop pre-header, and Mloop would be the loop header.

Reducibility

[edit]

A reducible CFG is one with edges that can be partitioned into two disjoint sets: forward edges, and back edges, such that:[5]

Structured programming languages are often designed such that all CFGs they produce are reducible, and common structured programming statements such as IF, FOR, WHILE, BREAK, and CONTINUE produce reducible graphs. To produce irreducible graphs, statements, such as GOTO, are needed. Irreducible CFGs can be produced by some compiler optimizations, such as tail call elimination. Many loop optimizations require reducible CFGs. In order to convert a irreducible CFG into a reducible CFG, either nodes must be duplicated or variables must be introduced. GOTO statements can sometimes produce reducible control flow graphs.

Loop connectedness

[edit]

The loop connectedness of a CFG is defined with respect to a given depth-first search tree (DFST) of the CFG. This DFST should be rooted at the start node and cover every node of the CFG.

Edges in the CFG which run from a node to one of its DFST ancestors (including itself) are called back edges.

The loop connectedness is the largest number of back edges found in any cycle-free path of the CFG. In a reducible CFG, the loop connectedness is independent of the DFST chosen.[6][7]

Loop connectedness has been used to reason about the time complexity of data-flow analysis.[6]

Inter-procedural control-flow graph

[edit]

While control-flow graphs represent the control flow of a single procedure, inter-procedural control-flow graphs represent the control flow of whole programs.[8]

See also

[edit]

References

[edit]
  1. ^ Frances E. Allen (July 1970). "Control flow analysis". SIGPLAN Notices. 5 (7): 1–19. doi:10.1145/390013.808479.
  2. ^ Reese T. Prosser (1959). "Applications of Boolean matrices to the analysis of flow diagrams". Papers presented at the December 1–3, 1959, eastern joint IRE-AIEE-ACM computer conference. pp. 133–138. doi:10.1145/1460299.1460314.
  3. ^ Yousefi, Javad (2015). "Masking wrong-successor Control Flow Errors employing data redundancy". 2015 5th International Conference on Computer and Knowledge Engineering (ICCKE). IEEE. pp. 201–205. doi:10.1109/ICCKE.2015.7365827. ISBN 978-1-4673-9280-8.
  4. ^ a b Peri L. Tarr; Alexander L. Wolf (2011). Engineering of Software: The Continuing Contributions of Leon J. Osterweil. Springer Science & Business Media. p. 58. ISBN 978-3-642-19823-6.
  5. ^ "Archived copy" (PDF). Archived from the original (PDF) on 2025-08-05. Retrieved 2025-08-05.{{cite web}}: CS1 maint: archived copy as title (link)
  6. ^ a b Kam, John B.; Ullman, Jeffrey D. (2025-08-05). "Global Data Flow Analysis and Iterative Algorithms". Journal of the ACM. 23 (1): 158–171. doi:10.1145/321921.321938. ISSN 0004-5411. S2CID 162375.
  7. ^ Offner, Carl. "Notes on Graph Algorithms Used in Optimizing Compilers" (PDF). Archived (PDF) from the original on 2025-08-05. Retrieved 13 April 2018.
  8. ^ "Control Flow Analysis" (PDF). 2016. Archived (PDF) from the original on 2025-08-05.
[edit]
Examples
上海什么时候解放的 唐僧的袈裟叫什么 宝宝吃什么增强抵抗力 hm是什么 什么快递比较快
生气过度会气出什么病 为什么越睡越困越疲惫 左侧小腹疼是什么原因 你什么我什么成语 梦见拉麦子是什么预兆
女人气血不足吃什么补 腿肿脚肿是什么病的前兆 h202阳性是什么意思 尿道炎什么症状 氨糖是什么
rj什么意思 什么是有机磷农药 血瘀吃什么中成药 升结肠管状腺瘤是什么意思 5月有什么节日
女人吃洋葱有什么好处hcv8jop5ns5r.cn 血脂高有什么危害hcv9jop4ns8r.cn 胃肠彩超能检查出什么hcv7jop5ns4r.cn 右脚麻是什么病的前兆hcv9jop4ns5r.cn 日匀念什么aiwuzhiyu.com
核桃不能和什么一起吃hcv9jop4ns9r.cn 香蕉有什么作用与功效hcv9jop5ns8r.cn 印尼用什么货币hcv9jop2ns5r.cn verde是什么颜色jingluanji.com 为什么会一直放屁hcv9jop4ns6r.cn
男人性功能太强是什么原因hcv8jop0ns9r.cn 身上长红痣是什么原因hcv9jop3ns6r.cn 梦见生女孩是什么征兆hcv8jop5ns3r.cn 猪和什么属相不合hcv8jop3ns1r.cn 1991年是什么命hcv9jop1ns5r.cn
msm是什么意思bjcbxg.com 吃什么补黄体酮最快hcv8jop9ns1r.cn 非即食是什么意思hcv8jop8ns1r.cn 10月26日什么星座hcv7jop5ns3r.cn ms什么意思hcv9jop3ns8r.cn
百度