Escape Analysis is an optimization phase in the compiler’s Middle End where the compiler determines the dynamic scope of pointers.
It decides whether a value can be allocated in the current stack frame (if it doesn’t escape) or if it needs to be allocated on the Heap (if it escapes).
