diff options
| author | Cliff Click <cliffc@acm.org> | 2026-09-17 12:30:07 -0700 |
|---|---|---|
| committer | Cliff Click <cliffc@acm.org> | 2026-09-17 12:30:07 -0700 |
| commit | 410ee209ba1db89959f8e6be9cdaf2350e70fd27 (patch) | |
| tree | 3e3a7beb862d96a6008978fb0affa8f3e5ee782c /chapter25 | |
| parent | 8adb94d5405d2235e721590d365beab8a8bf7696 (diff) | |
| download | Simple-410ee209ba1db89959f8e6be9cdaf2350e70fd27.tar.gz Simple-410ee209ba1db89959f8e6be9cdaf2350e70fd27.zip | |
Fix phi widening
Diffstat (limited to 'chapter25')
| -rw-r--r-- | chapter25/src/main/java/com/seaofnodes/simple/node/PhiNode.java | 8 | ||||
| -rw-r--r-- | chapter25/src/test/java/com/seaofnodes/simple/FuzzerWrap.java | 2 |
2 files changed, 4 insertions, 6 deletions
diff --git a/chapter25/src/main/java/com/seaofnodes/simple/node/PhiNode.java b/chapter25/src/main/java/com/seaofnodes/simple/node/PhiNode.java index 5ed4382f..4d357fda 100644 --- a/chapter25/src/main/java/com/seaofnodes/simple/node/PhiNode.java +++ b/chapter25/src/main/java/com/seaofnodes/simple/node/PhiNode.java @@ -90,12 +90,10 @@ public class PhiNode extends Node { // phi loop widening part if( r instanceof LoopNode && // Only around loops - t != _type && // Types changed and are falling (the optimistic case, expected to fall forever) - !t.isConstant() && // No need to widen constants - t instanceof TypeInteger newi && // Only widen integers - (!(_type instanceof TypeInteger oldi) || newi._widen <= oldi._widen) ) { + t instanceof TypeInteger ti && // Only widen integers + !ti.isConstant() ) { // No need to widen constants // Widen, to prevent infinite falling of TypeIntegers - return newi.same_but_slightly_wider_than(); + return ti.same_but_slightly_wider_than(); } return t; diff --git a/chapter25/src/test/java/com/seaofnodes/simple/FuzzerWrap.java b/chapter25/src/test/java/com/seaofnodes/simple/FuzzerWrap.java index 1ba123fe..66bc4717 100644 --- a/chapter25/src/test/java/com/seaofnodes/simple/FuzzerWrap.java +++ b/chapter25/src/test/java/com/seaofnodes/simple/FuzzerWrap.java @@ -30,10 +30,10 @@ public class FuzzerWrap { -8212834489697770130L, // bad keep/unkeep in parser 478567486335112458L, // dying escape node -5114548365532699915L, // dominate flags dependencies + -4710931876754133070L, // Tests monotonic phi widening }; private static final long[] OPEN_FAILING_SEEDS = { - -4710931876754133070L, }; |
