diff options
| author | Cliff Click <cliffc@acm.org> | 2026-09-28 15:42:57 -0700 |
|---|---|---|
| committer | Cliff Click <cliffc@acm.org> | 2026-09-28 15:42:57 -0700 |
| commit | 75390f477ac7d4568ac02f97358d146ff9879d6e (patch) | |
| tree | a6dc2226357ecb03359414b51f3de87034892aca /chapter25 | |
| parent | 586c8f65f2d0c0e1f73aadd0aa8d850aa653bddd (diff) | |
| download | Simple-75390f477ac7d4568ac02f97358d146ff9879d6e.tar.gz Simple-75390f477ac7d4568ac02f97358d146ff9879d6e.zip | |
Backport FunPtr
Helps keep functions alive via ptr only (no calls).
A few RISC 5 TFP encoding fixes.
Diffstat (limited to 'chapter25')
| -rw-r--r-- | chapter25/src/main/java/com/seaofnodes/simple/node/Node.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/chapter25/src/main/java/com/seaofnodes/simple/node/Node.java b/chapter25/src/main/java/com/seaofnodes/simple/node/Node.java index 8ca4662b..59c9f8e3 100644 --- a/chapter25/src/main/java/com/seaofnodes/simple/node/Node.java +++ b/chapter25/src/main/java/com/seaofnodes/simple/node/Node.java @@ -340,8 +340,11 @@ public abstract class Node implements Cloneable { while( nIns()>0 ) { // Set all inputs to null, recursively killing unused Nodes Node old_def = _inputs.removeLast(); // Revisit neighbor because removed use - if( old_def != null && CODE.add(old_def).delUse(this) ) - old_def.kill(); // If we removed the last use, the old def is now dead + if( old_def != null ) { + if( CODE.add(old_def).delUse(this) ) + old_def.kill(); // If we removed the last use, the old def is now dead + old_def.moveDepsToWorklist(); // Use-count changes can enable distant rewrites. + } } assert isDead(); // Really dead now } |
