MCPcopy Create free account
hub / github.com/SeaOfNodes/Simple / kills

Method kills

chapter23/src/main/java/com/seaofnodes/simple/codegen/IFG.java:202–226  ·  view source on GitHub ↗
( RegAlloc alloc, MachNode m )

Source from the content-addressed store, hash-verified

200 // *must* avoid this register, so instead of interfering we remove the
201 // single register from the other rmask.
202 private static void kills( RegAlloc alloc, MachNode m ) {
203 RegMask killMask = m.killmap();
204 if( killMask==null ) return;
205 // Kill registers with all live
206 for( LRG tlrg : TMP.keySet() ) {
207 assert tlrg.leader();
208 // Always, tlrg cannot use kills
209 if( tlrg._mask.overlap(killMask) ) {
210 // Disallow clone-ables from killing registers. Just fail
211 // them and re-clone closer to target... so no kill.
212 // Special case for Intel XOR used to zero.
213 Node n = (Node)m;
214 CFGNode effUseBlk = n.out(0) instanceof PhiNode phi ? phi.region().cfg(phi._inputs.find(n)) : n.out(0).cfg0();
215 if( m.isClone() && // Must be clonable
216 (n.nOuts()>1 || // Has many users OR
217 // Only 1 user but effective use is remote block
218 effUseBlk != n.cfg0() ))
219 // Then fail the clonable; it should split or move
220 alloc.fail(alloc.lrg((Node)m));
221 // Else clonable cannot move
222 else if( !tlrg.sub(killMask) )
223 alloc.fail(tlrg);
224 }
225 }
226 }
227
228 // Check for self-conflict live ranges. These must split, and only happens
229 // during the first round a particular LRG splits.

Callers 2

do_blockMethod · 0.95
do_nodeMethod · 0.95

Calls 13

outMethod · 0.95
cfg0Method · 0.95
nOutsMethod · 0.95
killmapMethod · 0.65
isCloneMethod · 0.65
leaderMethod · 0.45
overlapMethod · 0.45
cfgMethod · 0.45
regionMethod · 0.45
findMethod · 0.45
failMethod · 0.45
lrgMethod · 0.45

Tested by

no test coverage detected