Loop invariant motion now considers method arguments to be invariants of

any loop
This commit is contained in:
Alexey Andreev 2014-03-27 21:40:04 +04:00
parent cfd0f3e998
commit b2c78948f5

View File

@ -46,6 +46,9 @@ public class LoopInvariantMotion implements MethodOptimization {
IntegerStack stack = new IntegerStack(graph.size());
int[] defLocation = new int[program.variableCount()];
Arrays.fill(defLocation, -1);
for (int i = 0; i <= method.parameterCount(); ++i) {
defLocation[i] = 0;
}
for (int i = 0; i < domGraph.size(); ++i) {
if (dom.immediateDominatorOf(i) < 0) {
stack.push(i);