The purpose of this pass is to eliminate any statically determinable
dead-code. This is required to generate correct java bytecode. For example,
consider the following Java code:
void f(...) {
if(...) {
return ...;
else {
return ...;
}
}
Then, the front-end will produce the following (pseudo) bytecode:
void f(...) {
if(...) goto iftrue0;
return ...;
goto ifexit0;
iftrue0:
return ...;
ifexit0:
}
Here, we can see quite clearly that the code after the first return
statement, as well as the ifexit label, is dead.