summaryrefslogtreecommitdiff
path: root/chapter21/src
diff options
context:
space:
mode:
authorCliff Click <cliffc@acm.org>2025-04-03 11:31:06 -0700
committerCliff Click <cliffc@acm.org>2025-04-03 11:31:06 -0700
commitcc32b0cf801620f1d289cb6ae183e079111540fc (patch)
tree0cc40b8233cefc22370b0b845ca604344716b0be /chapter21/src
parent37b46799c03244241d589085e24582bef8a59efb (diff)
downloadSimple-cc32b0cf801620f1d289cb6ae183e079111540fc.tar.gz
Simple-cc32b0cf801620f1d289cb6ae183e079111540fc.zip
Fix RA parallel phi assign
Force spills when phi uses phi same loop header. This is effectively a parallel assignment, generally shifting values from one iteration to the next.
Diffstat (limited to 'chapter21/src')
-rw-r--r--chapter21/src/main/java/com/seaofnodes/simple/codegen/RegAlloc.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/chapter21/src/main/java/com/seaofnodes/simple/codegen/RegAlloc.java b/chapter21/src/main/java/com/seaofnodes/simple/codegen/RegAlloc.java
index 56b5aa52..9042de3b 100644
--- a/chapter21/src/main/java/com/seaofnodes/simple/codegen/RegAlloc.java
+++ b/chapter21/src/main/java/com/seaofnodes/simple/codegen/RegAlloc.java
@@ -410,7 +410,7 @@ public class RegAlloc {
// splitting in inner loop or at loop border
(min==max || phi.region().cfg(i).loopDepth() <= min) &&
// and not around the backedge of a loop (bad place to force a split, hard to remove)
- !(phi.region() instanceof LoopNode && i==2) )
+ !(phi.region() instanceof LoopNode && i==2 && (phi.in(i) instanceof PhiNode pp && pp.region()==phi.region())) )
// Split before phi-use in prior block
insertBefore(phi,i, "use/loop/phi",round,lrg);