30
30
31
31
import org .graalvm .collections .EconomicMap ;
32
32
33
- import jdk .graal .compiler .vector .replacements .vectorapi .VectorAPIOperations ;
34
- import jdk .graal .compiler .vector .replacements .vectorapi .VectorAPIUtils ;
35
-
36
33
import jdk .graal .compiler .core .common .calc .Condition ;
37
34
import jdk .graal .compiler .core .common .type .Stamp ;
38
35
import jdk .graal .compiler .debug .GraalError ;
52
49
import jdk .graal .compiler .vector .architecture .VectorArchitecture ;
53
50
import jdk .graal .compiler .vector .nodes .simd .SimdMaskLogicNode ;
54
51
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 ;
55
54
import jdk .vm .ci .meta .JavaKind ;
56
55
57
56
/**
@@ -168,6 +167,9 @@ public Node canonical(CanonicalizerTool tool) {
168
167
169
168
@ Override
170
169
public boolean canExpand (VectorArchitecture vectorArch , EconomicMap <ValueNode , Stamp > simdStamps ) {
170
+ if (condition == null ) {
171
+ return false ;
172
+ }
171
173
if (vectorArch .logicVectorsAreBitmasks ()) {
172
174
SimdStamp simdStamp = (SimdStamp ) simdStamps .get (vectorX ());
173
175
Stamp logicElement = simdStamp .getComponent (0 );
@@ -179,13 +181,13 @@ public boolean canExpand(VectorArchitecture vectorArch, EconomicMap<ValueNode, S
179
181
@ Override
180
182
public ValueNode expand (VectorArchitecture vectorArch , NodeMap <ValueNode > expanded ) {
181
183
ValueNode x = expanded .get (vectorX ());
182
- ValueNode originalY = vectorY ();
183
184
/*
184
185
* We don't want to look at the second argument, it only encodes our operation. All the
185
186
* 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.
187
190
*/
188
- GraalError .guarantee (originalY instanceof VectorAPIFromBitsCoercedNode , "second argument to test should be fromBitsCoerced: %s" , originalY );
189
191
190
192
ValueNode logicVector ;
191
193
if (vectorArch .logicVectorsAreBitmasks ()) {
0 commit comments