|
1 | 1 | /*
|
2 |
| - * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. |
| 2 | + * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
4 | 4 | *
|
5 | 5 | * This code is free software; you can redistribute it and/or modify it
|
|
37 | 37 | import jdk.graal.compiler.nodes.BeginStateSplitNode;
|
38 | 38 | import jdk.graal.compiler.nodes.LoopExitNode;
|
39 | 39 | import jdk.graal.compiler.nodes.MemoryProxyNode;
|
| 40 | +import jdk.graal.compiler.nodes.SafepointNode; |
40 | 41 | import jdk.graal.compiler.nodes.ValueProxyNode;
|
41 | 42 | import jdk.graal.compiler.nodes.spi.Canonicalizable;
|
42 | 43 | import jdk.graal.compiler.nodes.spi.CanonicalizerTool;
|
@@ -70,10 +71,11 @@ public Node canonical(CanonicalizerTool tool) {
|
70 | 71 | public boolean verifyNode() {
|
71 | 72 | if (predecessor() instanceof LoopExitNode loopExit) {
|
72 | 73 | /*
|
73 |
| - * Must guarantee only value and memory proxies are attached to the loop exit. Anything |
74 |
| - * else should be attached to this node |
| 74 | + * Must guarantee that only value and memory proxies or safepoints are attached to the |
| 75 | + * loop exit. Anything else should be attached to this node. |
75 | 76 | */
|
76 |
| - assert loopExit.usages().stream().allMatch(NodePredicates.isA(ValueProxyNode.class).or(MemoryProxyNode.class)) : String.format("LoopExit has disallowed usages %s", loopExit); |
| 77 | + assert loopExit.usages().stream().allMatch(NodePredicates.isA(ValueProxyNode.class).or(MemoryProxyNode.class).or(SafepointNode.class)) : String.format( |
| 78 | + "LoopExit %s has disallowed usages %s", loopExit, loopExit.usages().snapshot()); |
77 | 79 | }
|
78 | 80 |
|
79 | 81 | return super.verifyNode();
|
|
0 commit comments