diff --git a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/vector/replacements/vectorapi/VectorAPIExpansionPhase.java b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/vector/replacements/vectorapi/VectorAPIExpansionPhase.java index 030d59c62c0b..0618dd7aa61c 100644 --- a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/vector/replacements/vectorapi/VectorAPIExpansionPhase.java +++ b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/vector/replacements/vectorapi/VectorAPIExpansionPhase.java @@ -729,6 +729,11 @@ private static ValueNode visitPhiForExpansion(StructuredGraph graph, NodeMap expanded, VectorArchitecture vectorArch) { for (ValueNode node : component.simdStamps.getKeys()) { + if (!node.isAlive()) { + // As we kill CFGs while replacing each element of the component, it may be the case + // that an element is killed because its control dies, simply skip those elements + continue; + } ValueNode replacement = expanded.get(node); GraalError.guarantee(replacement != null, "node was not expanded: %s", node); graph.getDebug().dump(DebugContext.VERY_DETAILED_LEVEL, graph, "before replacing %s -> %s", node, replacement);