Fix bug in LoopInversion

This commit is contained in:
Alexey Andreev 2016-06-19 11:52:14 +03:00 committed by Alexey Andreev
parent 920a17ff63
commit 3ac7bd1c68
2 changed files with 4 additions and 0 deletions

View File

@ -359,6 +359,9 @@ class LoopInversionImpl {
for (int node = 0; node < cfg.size(); ++node) {
BasicBlock block = program.basicBlockAt(node);
if (copiedNodes.containsKey(block.getIndex())) {
continue;
}
for (Phi phi : block.getPhis()) {
for (Incoming incoming : phi.getIncomings().toArray(new Incoming[0])) {
int source = incoming.getSource().getIndex();

View File

@ -737,6 +737,7 @@ public class TeaVM implements TeaVMHost, ServiceRepository {
private List<MethodOptimization> getOptimizations() {
return Arrays.asList(
new RedundantJumpElimination(),
new ArrayUnwrapMotion(),
new LoopInversion(),
new LoopInvariantMotion(),