summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCliff Click <cliffc@acm.org>2026-12-05 16:50:40 -0800
committerCliff Click <cliffc@acm.org>2026-12-05 16:50:40 -0800
commit1ff8f700bc7570852357a0514cb3cc9c66af5657 (patch)
tree6e7e5a286f4ab373962d546b1fdce10442bcb550
parent6cc2ed4147962b8a2155e2948bbdd5cf10856e90 (diff)
downloadSimple-1ff8f700bc7570852357a0514cb3cc9c66af5657.tar.gz
Simple-1ff8f700bc7570852357a0514cb3cc9c66af5657.zip
Fix opto stanza, fix iterch33_try2
-rw-r--r--chapter33/src/main/java/com/seaofnodes/simple/codegen/Iter.java9
-rw-r--r--chapter33/src/main/java/com/seaofnodes/simple/codegen/Opto.java11
2 files changed, 12 insertions, 8 deletions
diff --git a/chapter33/src/main/java/com/seaofnodes/simple/codegen/Iter.java b/chapter33/src/main/java/com/seaofnodes/simple/codegen/Iter.java
index 04c4378f..30efea28 100644
--- a/chapter33/src/main/java/com/seaofnodes/simple/codegen/Iter.java
+++ b/chapter33/src/main/java/com/seaofnodes/simple/codegen/Iter.java
@@ -27,12 +27,15 @@ public abstract class Iter {
// feeds spurious escapes around the Start/Stop cycle, where ordinary
// lifting cannot recover the exclusions.
switch( t ) {
- case TypeMem mem ->
+ case TypeMem mem -> {
return TypeMem.make( mem._alias, iterImportReset( mem._t ), mem._one, mem._clz, mem._final, mem._escFs, mem._escAs );
- case TypeMemPtr typeMemPtr ->
+ }
+ case TypeMemPtr typeMemPtr -> {
return t.makeStorage();
- case TypeStruct typeStruct ->
+ }
+ case TypeStruct typeStruct -> {
return t.makeStorage();
+ }
case TypeTuple tt -> {
TypeTuple rez = tt;
for( int i = 0; i < tt._types.length; i++ ) {
diff --git a/chapter33/src/main/java/com/seaofnodes/simple/codegen/Opto.java b/chapter33/src/main/java/com/seaofnodes/simple/codegen/Opto.java
index 6e379cb6..0b579d2a 100644
--- a/chapter33/src/main/java/com/seaofnodes/simple/codegen/Opto.java
+++ b/chapter33/src/main/java/com/seaofnodes/simple/codegen/Opto.java
@@ -236,11 +236,6 @@ abstract public class Opto {
if( n.isDead() ) continue;
count++;
Type oval = n._type, nval = n.compute();
- if( n instanceof CLInitNode init ) init.link();
- // A non-returning summary can still call other functions. Use entry
- // reachability, not its returned control, even if nval is unchanged.
- if( n instanceof SummaryNode summary && !summary.in(0)._type.isHigh() )
- summary.linkCallees();
// Remember possible peephole work without walking the graph again.
// SCCP can still fall back to the old type, so filter at the end.
if( nval!=oldTypes.atX(n._nid) || n.isUnlocked() ) changes.push(n);
@@ -279,6 +274,12 @@ abstract public class Opto {
if( n instanceof StartNode )
linkStart(code,(TypeTuple)n._type);
+ if( n instanceof CLInitNode init ) init.link();
+ // A non-returning summary can still call other functions. Use entry
+ // reachability, not its returned control, even if nval is unchanged.
+ if( n instanceof SummaryNode summary && !summary.in(0)._type.isHigh() )
+ summary.linkCallees();
+
// Since n._type changed, visit all output neighbors
code._iter.addAll(n._outputs);
// SCCP consumes these without running peepholes. Save them for