@@ -2512,7 +2512,7 @@ void registerizeHarder(Ref ast) {
2512
2512
2513
2513
// Traverse the tree in execution order and synthesize a basic flow-graph.
2514
2514
// It's convenient to build a kind of "dual" graph where the nodes identify
2515
- // the junctions between blocks at which control-flow may branch, and each
2515
+ // the junctions between blocks at which control-flow may branch, and each
2516
2516
// basic block is an edge connecting two such junctions.
2517
2517
// For each junction we store:
2518
2518
// * set of blocks that originate at the junction
@@ -2646,9 +2646,9 @@ void registerizeHarder(Ref ast) {
2646
2646
};
2647
2647
2648
2648
auto markNonLocalJump = [&](IString type, IString label) {
2649
- // Complete a block via RETURN, BREAK or CONTINUE.
2649
+ // Complete a block via RETURN, BREAK or CONTINUE.
2650
2650
// This joins the targetted junction and then sets the current junction to null.
2651
- // Any code traversed before we get back an existing junction is dead code.
2651
+ // Any code traversed before we get back to an existing junction is dead code.
2652
2652
if (type == RETURN) {
2653
2653
joinJunction (EXIT_JUNCTION, false );
2654
2654
} else {
@@ -3467,9 +3467,11 @@ void registerizeHarder(Ref ast) {
3467
3467
for (int k = freeRegs.size () - 1 ; k >= 0 ; k--) {
3468
3468
reg = freeRegs[k];
3469
3469
// Check for conflict with input registers.
3470
- if (block->firstKillLoc [name] <= inputDeadLoc[reg]) {
3471
- if (name != inputVarsByReg[reg]) {
3472
- continue ;
3470
+ if (inputDeadLoc.count (reg) > 0 ) {
3471
+ if (block->firstKillLoc [name] <= inputDeadLoc[reg]) {
3472
+ if (name != inputVarsByReg[reg]) {
3473
+ continue ;
3474
+ }
3473
3475
}
3474
3476
}
3475
3477
// Found one!
@@ -3497,7 +3499,7 @@ void registerizeHarder(Ref ast) {
3497
3499
}
3498
3500
}
3499
3501
}
3500
- // If we managed to create an "x=x" assignments, remove them.
3502
+ // If we managed to create any "x=x" assignments, remove them.
3501
3503
for (int j = 0 ; j < maybeRemoveNodes.size (); j++) {
3502
3504
Ref node = maybeRemoveNodes[j].second ;
3503
3505
if (node[2 ][1 ] == node[3 ][1 ]) {
0 commit comments