In the absence of a complete graph analysis, we can still remove some simple cases like:
- Anything from a "ret" instruction until next "_label"
- Anything from a "jmp" instruction until next "_label"
One example of the first case being created by the compiler, is at the end of an if block, right before an "else" or an "elseif", if there is an "EXIT SUB/FUNCTION" statement. The compiler generates a JMP instruction afterwards to the end of the IF block, which is unreachable.
In the absence of a complete graph analysis, we can still remove some simple cases like:
One example of the first case being created by the compiler, is at the end of an if block, right before an "else" or an "elseif", if there is an "EXIT SUB/FUNCTION" statement. The compiler generates a JMP instruction afterwards to the end of the IF block, which is unreachable.