docs: Add dominance frontier to basic_block_t

Signed-off-by: Ronald Caesar <github43132@proton.me>
This commit is contained in:
Ronald Caesar
2025-12-26 13:28:44 -04:00
parent 743b843986
commit 5f23adb4b5

View File

@@ -227,7 +227,39 @@ typedef struct
uint16_t instruction_count;
uint16_t phi_count;
// If variable gets defined in Block X, this tracks where the definition
// collide with other blocks.
//
// If-Else:
//
// A
// / \
// B C
// \ /
// D
//
// B defines x = 1.
// B dominates itself. It does not dominate D.
// The frontier of B is D.
// We insert x = phi(...) in D.
// basic_blocks[B].dominance_frontier_start = D
//
// For Loop:
//
// A <---|
// | |
// B --->|
//
// B defines i = i + 1
// B dominates itself. It does not dominante A.
// The frontier of B is A.
// We insert i = phi(...) in A.
// badic_blocks[B].dominance_frontier_start = A;
//
uint16_t dominance_frontier_start;
uint16_t dominance_frontier_count;
// Used to order hot and cold blocks in memory.
uint32_t execution_count;
} basic_block_t;