控制依赖:在程序分析/编译器中指一种关系——某条语句(或基本块)是否会被执行,取决于某个分支条件(如 if/else、switch、循环条件)的结果。它常用于构建程序依赖图(PDG)、进行优化与安全分析。(在不同语境下也可能与“控制流依赖”相关联。)
/ kənˈtroʊl dɪˈpɛndəns /
Control dependence helps the compiler understand which code runs after an if statement.
控制依赖帮助编译器理解在 if 语句之后哪些代码会被执行。
In a program dependence graph, statements inside a loop body are typically control-dependent on the loop’s condition, which affects slicing and optimization decisions.
在程序依赖图中,循环体内的语句通常对循环条件存在控制依赖,这会影响程序切片与优化决策。
该术语由 control(控制/控制流) 与 dependence(依赖关系) 组合而来:强调“执行路径由控制条件决定”的依赖关系。它在编译器理论中与数据流分析一同发展,用于更精确地刻画程序结构与影响范围。