src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ConditionalEliminationPhase.java
changeset 58299 6df94ce3ab2f
parent 57537 ecc6e394475f
child 58679 9c3209ff7550
child 58877 aec7bf35d6f5
equal deleted inserted replaced
58298:0152ad7b38b8 58299:6df94ce3ab2f
     1 /*
     1 /*
     2  * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   307             this.map = graph.createNodeMap();
   307             this.map = graph.createNodeMap();
   308             this.pendingTests = new ArrayDeque<>();
   308             this.pendingTests = new ArrayDeque<>();
   309             this.conditions = new ArrayDeque<>();
   309             this.conditions = new ArrayDeque<>();
   310             tool = GraphUtil.getDefaultSimplifier(context.getMetaAccess(), context.getConstantReflection(), context.getConstantFieldProvider(), false, graph.getAssumptions(), graph.getOptions(),
   310             tool = GraphUtil.getDefaultSimplifier(context.getMetaAccess(), context.getConstantReflection(), context.getConstantFieldProvider(), false, graph.getAssumptions(), graph.getOptions(),
   311                             context.getLowerer());
   311                             context.getLowerer());
   312             mergeMaps = EconomicMap.create();
   312             mergeMaps = EconomicMap.create(Equivalence.IDENTITY);
   313         }
   313         }
   314 
   314 
   315         protected void processConditionAnchor(ConditionAnchorNode node) {
   315         protected void processConditionAnchor(ConditionAnchorNode node) {
   316             tryProveCondition(node.condition(), (guard, result, guardedValueStamp, newInput) -> {
   316             tryProveCondition(node.condition(), (guard, result, guardedValueStamp, newInput) -> {
   317                 if (result != node.isNegated()) {
   317                 if (result != node.isNegated()) {
   614                     InfoElement infoElement = this.getInfoElements(valueAt);
   614                     InfoElement infoElement = this.getInfoElements(valueAt);
   615                     while (infoElement != null) {
   615                     while (infoElement != null) {
   616                         Stamp newStamp = infoElement.getStamp();
   616                         Stamp newStamp = infoElement.getStamp();
   617                         if (phi.stamp(NodeView.DEFAULT).tryImproveWith(newStamp) != null) {
   617                         if (phi.stamp(NodeView.DEFAULT).tryImproveWith(newStamp) != null) {
   618                             if (mergeMap == null) {
   618                             if (mergeMap == null) {
   619                                 mergeMap = EconomicMap.create();
   619                                 mergeMap = EconomicMap.create(Equivalence.IDENTITY);
   620                                 mergeMaps.put(merge, mergeMap);
   620                                 mergeMaps.put(merge, mergeMap);
   621                             }
   621                             }
   622 
   622 
   623                             PhiInfoElement phiInfoElement = mergeMap.get(phi);
   623                             PhiInfoElement phiInfoElement = mergeMap.get(phi);
   624                             if (phiInfoElement == null) {
   624                             if (phiInfoElement == null) {