diff options
| author | Thalia Archibald <thalia@archibald.dev> | 2024-03-03 17:55:47 +0000 |
|---|---|---|
| committer | Thalia Archibald <thalia@archibald.dev> | 2024-10-23 17:51:09 -0700 |
| commit | 9ed409df4516e0089afbc7d5ccf9b029d431be04 (patch) | |
| tree | c0ae90716b9551dc0e58d0ec52f5e4e91bb1152f /src/main/java/com/seaofnodes/simple/IRPrinter.java | |
| parent | 425f05826799e9da06a630187d2ad05c656266a1 (diff) | |
| download | Simple-linear-chapter09.tar.gz Simple-linear-chapter09.zip | |
Chapter 9: Global Value Numbering and Iterative Peepholeslinear-chapter09
Co-authored-by: Cliff Click <cliffc@acm.org>
Co-authored-by: XmiliaH <45106915+XmiliaH@users.noreply.github.com>
Co-authored-by: Robert Obkircher <robert.obkircher@gmail.com>
Co-authored-by: Dibyendu Majumdar <mobile@majumdar.org.uk>
Co-authored-by: Darrick Wiebe <darrickw@untether.ai>
Diffstat (limited to 'src/main/java/com/seaofnodes/simple/IRPrinter.java')
| -rw-r--r-- | src/main/java/com/seaofnodes/simple/IRPrinter.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/com/seaofnodes/simple/IRPrinter.java b/src/main/java/com/seaofnodes/simple/IRPrinter.java index 2a6dbefd..c06ac9d0 100644 --- a/src/main/java/com/seaofnodes/simple/IRPrinter.java +++ b/src/main/java/com/seaofnodes/simple/IRPrinter.java @@ -48,14 +48,15 @@ public class IRPrinter { // First walk the CFG, then everything if( n.isCFG() ) { for( Node use : n._outputs ) - if( use.isCFG() && use.nOuts()>=1 && !(use._outputs.get(0) instanceof LoopNode) ) + if( use!=null && use.isCFG() && use.nOuts()>=1 && !(use._outputs.get(0) instanceof LoopNode) ) postOrd(use, rpos,visit,bfs); for( Node use : n._outputs ) - if( use.isCFG() ) + if( use!=null && use.isCFG() ) postOrd(use,rpos,visit,bfs); } for( Node use : n._outputs ) - postOrd(use, rpos,visit,bfs); + if( use != null ) + postOrd(use, rpos,visit,bfs); // Post-order rpos.add(n); } |
