4 ms·
Suppose you "go generate" code which ends up having something along the lines of: x := true var y = 0 if x { y = 10 } else { y
by junke 10y ago
Suppose you "go generate" code which ends up having something along the lines of:
x := true
var y = 0
if x {
y = 10
} else {
y = 20
}
In that case dead code elimination might require a little more analysis than checking for unassigned expressions and unused variables.
So the question might be: what kind of dead code elimination exist in the compiler, apart from what you describe which has existed since the beginning of Go? (if I understand correctly)