Skip to content

Commit 4d9da0c

Browse files
committed
[JDK-8357432] Remove incorrect guarantee in VectorAPITestNode
PullRequest: graal/21051
2 parents f321c30 + 9fbd223 commit 4d9da0c

File tree

1 file changed

+8
-6
lines changed
  • compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/vector/replacements/vectorapi/nodes

1 file changed

+8
-6
lines changed

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/vector/replacements/vectorapi/nodes/VectorAPITestNode.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@
3030

3131
import org.graalvm.collections.EconomicMap;
3232

33-
import jdk.graal.compiler.vector.replacements.vectorapi.VectorAPIOperations;
34-
import jdk.graal.compiler.vector.replacements.vectorapi.VectorAPIUtils;
35-
3633
import jdk.graal.compiler.core.common.calc.Condition;
3734
import jdk.graal.compiler.core.common.type.Stamp;
3835
import jdk.graal.compiler.debug.GraalError;
@@ -52,6 +49,8 @@
5249
import jdk.graal.compiler.vector.architecture.VectorArchitecture;
5350
import jdk.graal.compiler.vector.nodes.simd.SimdMaskLogicNode;
5451
import jdk.graal.compiler.vector.nodes.simd.SimdStamp;
52+
import jdk.graal.compiler.vector.replacements.vectorapi.VectorAPIOperations;
53+
import jdk.graal.compiler.vector.replacements.vectorapi.VectorAPIUtils;
5554
import jdk.vm.ci.meta.JavaKind;
5655

5756
/**
@@ -168,6 +167,9 @@ public Node canonical(CanonicalizerTool tool) {
168167

169168
@Override
170169
public boolean canExpand(VectorArchitecture vectorArch, EconomicMap<ValueNode, Stamp> simdStamps) {
170+
if (condition == null) {
171+
return false;
172+
}
171173
if (vectorArch.logicVectorsAreBitmasks()) {
172174
SimdStamp simdStamp = (SimdStamp) simdStamps.get(vectorX());
173175
Stamp logicElement = simdStamp.getComponent(0);
@@ -179,13 +181,13 @@ public boolean canExpand(VectorArchitecture vectorArch, EconomicMap<ValueNode, S
179181
@Override
180182
public ValueNode expand(VectorArchitecture vectorArch, NodeMap<ValueNode> expanded) {
181183
ValueNode x = expanded.get(vectorX());
182-
ValueNode originalY = vectorY();
183184
/*
184185
* We don't want to look at the second argument, it only encodes our operation. All the
185186
* relevant information about it should have been computed when this node was built or
186-
* canonicalized (see the computeCondition() method).
187+
* canonicalized (see the computeCondition() method). When this node was originally created,
188+
* its input was a VectorAPIFromBitsCoercedNode, but we cannot guarantee that here because
189+
* the graph may have changed in the meantime.
187190
*/
188-
GraalError.guarantee(originalY instanceof VectorAPIFromBitsCoercedNode, "second argument to test should be fromBitsCoerced: %s", originalY);
189191

190192
ValueNode logicVector;
191193
if (vectorArch.logicVectorsAreBitmasks()) {

0 commit comments

Comments
 (0)