diff options
| -rw-r--r-- | chapter33/src/main/java/com/seaofnodes/simple/codegen/Iter.java | 9 | ||||
| -rw-r--r-- | chapter33/src/main/java/com/seaofnodes/simple/codegen/Opto.java | 11 |
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 |
