mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2025-01-09 00:14:10 -08:00
Loop invariant motion now considers method arguments to be invariants of
any loop
This commit is contained in:
parent
cfd0f3e998
commit
b2c78948f5
|
@ -46,6 +46,9 @@ public class LoopInvariantMotion implements MethodOptimization {
|
||||||
IntegerStack stack = new IntegerStack(graph.size());
|
IntegerStack stack = new IntegerStack(graph.size());
|
||||||
int[] defLocation = new int[program.variableCount()];
|
int[] defLocation = new int[program.variableCount()];
|
||||||
Arrays.fill(defLocation, -1);
|
Arrays.fill(defLocation, -1);
|
||||||
|
for (int i = 0; i <= method.parameterCount(); ++i) {
|
||||||
|
defLocation[i] = 0;
|
||||||
|
}
|
||||||
for (int i = 0; i < domGraph.size(); ++i) {
|
for (int i = 0; i < domGraph.size(); ++i) {
|
||||||
if (dom.immediateDominatorOf(i) < 0) {
|
if (dom.immediateDominatorOf(i) < 0) {
|
||||||
stack.push(i);
|
stack.push(i);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user