This is a pretty bad oversight which might cause all sorts of issues, so we might want to pull it onto the 4.3 branch as well.
As fallout, we now hoist static locals inside unrollable loops in order to avoid duplicate declarations. Looking at this makes we wonder if we shouldn't always hoist local declarations in these cases to avoid declaring multiple variables unnecessarily.
Turns out doing this for non-statics isn't so easy because of local functions and threads, so let's not do this after all. I still did some related cleanup, so this should be good regardless.
This is a pretty bad oversight which might cause all sorts of issues, so we might want to pull it onto the 4.3 branch as well.
As fallout, we now hoist static locals inside unrollable loops in order to avoid duplicate declarations. Looking at this makes we wonder if we shouldn't always hoist local declarations in these cases to avoid declaring multiple variables unnecessarily.