Skip to content

Commit a65ec78

Browse files
committed
[GR-53299] Rewire all usages in LoopFragmentInside.placeNewSegmentAndCleanup
PullRequest: graal/17543
2 parents 99c1ca9 + 11e25fc commit a65ec78

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/nodes/loop/LoopFragmentInside.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -282,6 +282,13 @@ protected CompareNode placeNewSegmentAndCleanup(LoopEx loop, EconomicMap<Node, N
282282

283283
if (mainCounted.getBody() != loop.loopBegin()) {
284284
// regular loop
285+
Node predecessor = newSegmentLoopTest.predecessor();
286+
while (predecessor instanceof FixedWithNextNode fixedPredecessor) {
287+
for (Node usage : fixedPredecessor.usages().snapshot()) {
288+
usage.replaceFirstInput(fixedPredecessor, loopTest.predecessor());
289+
}
290+
predecessor = fixedPredecessor.predecessor();
291+
}
285292
AbstractBeginNode falseSuccessor = newSegmentLoopTest.falseSuccessor();
286293
for (Node usage : falseSuccessor.anchored().snapshot()) {
287294
usage.replaceFirstInput(falseSuccessor, loopTest.falseSuccessor());

0 commit comments

Comments
 (0)