| 200 | // Single-register defines *must* have their register; other live ranges |
| 201 | // *must* avoid this register, so instead of interfering we remove the |
| 202 | // single register from the other rmask. |
| 203 | private static void kills( RegAlloc alloc, MachNode m ) { |
| 204 | RegMask killMask = m.killmap(); |
| 205 | if( killMask==null ) return; |
| 206 | // Kill registers with all live |
| 207 | for( LRG tlrg : TMP.keySet() ) { |
| 208 | assert tlrg.leader(); |
| 209 | // Always, tlrg cannot use kills |
| 210 | if( tlrg._mask.overlap(killMask) ) { |
| 211 | if( !tlrg.sub(killMask) ) alloc.fail(tlrg); |
| 212 | } |
| 213 | } |
| 214 | } |
| 215 | |
| 216 | // Check for self-conflict live ranges. These must split, and only happens |
| 217 | // during the first round a particular LRG splits. |
| 218 | private static void selfConflict(RegAlloc alloc, Node n, LRG lrg) { |
| 219 | selfConflict(alloc,n,lrg,TMP.get(lrg)); |
| 220 | } |
| 221 | private static void selfConflict(RegAlloc alloc, Node n, LRG lrg, Node prior) { |
| 222 | if( prior!=null && prior != n ) { |
| 223 | lrg.selfConflict(prior); |
| 224 | lrg.selfConflict(n); |
| 225 | alloc.fail(lrg); // 2 unrelated values live at once same live range; self-conflict |
| 226 | } |
| 227 | } |
| 228 | |
| 229 | // Merge TMP into bb's live-out set; if changes put bb on WORK |