@@ -345,7 +345,6 @@ def last_name(
345
345
LocalIRVariable ,
346
346
],
347
347
init_vars : Dict [str , LocalIRVariable ],
348
- new_variables : List [Union [StateIRVariable , LocalIRVariable ]],
349
348
) -> Union [StateIRVariable , LocalIRVariable ,]:
350
349
candidates = []
351
350
# Todo optimize by creating a variables_ssa_written attribute
@@ -360,9 +359,6 @@ def last_name(
360
359
candidates .append (LocalIRVariable (n .variable_declaration ))
361
360
if var .name in init_vars :
362
361
candidates .append (init_vars [var .name ])
363
- for v in new_variables :
364
- if v .name == var .name :
365
- candidates .append (v )
366
362
assert candidates
367
363
return max (candidates , key = lambda v : v .index )
368
364
@@ -496,25 +492,9 @@ def fix_phi_rvalues_and_storage_ref(
496
492
) -> None :
497
493
for ir in node .irs_ssa :
498
494
if isinstance (ir , (Phi )) and not ir .rvalues :
499
- # We need to order nodes so that a node with an Assignment operation is first
500
- # as the other node may use the variable assigned
501
- nodes = []
502
- for n in ir .nodes :
503
- assignment = False
504
- for irr in n .irs :
505
- if isinstance (irr , Assignment ):
506
- nodes .insert (0 , n )
507
- assignment = True
508
- break
509
- if not assignment :
510
- nodes .append (n )
511
- # Keep track of the new variables in this set of nodes. We need to pass it to last_name
512
- # in case a node has an Assignment operation and the following one uses the variable assigned
513
- variables = []
514
- for dst in nodes :
515
- variables .append (
516
- last_name (dst , ir .lvalue , init_local_variables_instances , variables )
517
- )
495
+ variables = [
496
+ last_name (dst , ir .lvalue , init_local_variables_instances ) for dst in ir .nodes
497
+ ]
518
498
ir .rvalues = variables
519
499
if isinstance (ir , (Phi , PhiCallback )):
520
500
if isinstance (ir .lvalue , LocalIRVariable ):
0 commit comments