diff options
| author | Cliff Click <cliffc@acm.org> | 2025-04-28 09:05:55 -0700 |
|---|---|---|
| committer | Cliff Click <cliffc@acm.org> | 2025-04-28 09:05:55 -0700 |
| commit | fe52d80f4a25b2df1954b42395123de652b953df (patch) | |
| tree | d3e652a441e1f591fb245dd667c845a13e276d92 /chapter21 | |
| parent | f41a1805f2157a2190c1f76c748c3e3bbaacbf04 (diff) | |
| download | Simple-fe52d80f4a25b2df1954b42395123de652b953df.tar.gz Simple-fe52d80f4a25b2df1954b42395123de652b953df.zip | |
cherrypick
manual cherrypick
07876008acfa142b3ce4416326848b5fbb167144
Diffstat (limited to 'chapter21')
| -rw-r--r-- | chapter21/src/main/java/com/seaofnodes/simple/codegen/RegAlloc.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/chapter21/src/main/java/com/seaofnodes/simple/codegen/RegAlloc.java b/chapter21/src/main/java/com/seaofnodes/simple/codegen/RegAlloc.java index e1051fc6..49f057a3 100644 --- a/chapter21/src/main/java/com/seaofnodes/simple/codegen/RegAlloc.java +++ b/chapter21/src/main/java/com/seaofnodes/simple/codegen/RegAlloc.java @@ -295,9 +295,12 @@ public class RegAlloc { // Check all use inputs for n, in case there's several for( int i = 1; i < use.nIns(); i++ ) // Find a def input, and check register class - if( use.in( i ) == def && mach.regmap( i ).overlap( rmask ) ) - // Modify use to use the split version specialized to this rclass - { use.setDef( i, split ); j--; break; } + if( use.in( i ) == def ) { + RegMask m = mach.regmap( i ); + if( m!=null && mach.regmap( i ).overlap( rmask ) ) + // Modify use to use the split version specialized to this rclass + { use.setDefOrdered( i, split ); j--; break; } + } } } } |
