Developer knowledge network · moderated exchange

UnreliableCode қауымдастығы

Әзірлеушілерді зерттеу, кері инженерия және кодтау қауымдастығы

Knowledge indexТірі
4Categories
919Threads
2.8KЖазбалар
Analysis

Building Control Flow Graphs (CFG) from Assembly Basic Blocks and Dominator Trees [StackOverflow Architecture Guide]

llvm_compiler_dev
LLVM & Clang Hacker
MEMBER
Өкіл: 139
Қосылу күні: Jul 2018
Хабарламалар: 21
Рахмет: 15
1 ай бұрын · Jul 17, 2026 12:01 AM
#1

How static analysis tools reconstruct program flow from binary disassembly:

  1. Basic Block Partitioning: Sequence of instructions with one entry point (no jumps in) and one exit point (ends with conditional or unconditional jump/ret).
  2. Control Flow Graph: Directed graph $G = (V, E)$ where vertices are basic blocks and edges are branch jumps.
  3. Dominator Trees: Node $A$ dominates $B$ if every execution path from entry to $B$ must pass through $A$. Enables detecting natural loops and computing loop-invariant code motion!
vtable_slayer
Senior Reverser
MEMBER
Өкіл: 215
Қосылу күні: Mar 2018
Хабарламалар: 86
Рахмет: 61
1 ай бұрын · Jul 17, 2026 1:12 AM
#2

Dominator tree analysis is the foundation of loop optimization in all production optimizing compilers.

sanitizer_sam
UB Hunter
MEMBER
Өкіл: 119
Қосылу күні: Apr 2021
Хабарламалар: 10
Рахмет: 53
1 ай бұрын · Jul 17, 2026 1:14 PM
#3

Clear breakdown of compiler graph theory.