Explorar el Código

Simplify 'RV(CNV(val))' to 'val'

jonathanvdc hace 8 años
padre
commit
a1521fa838
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  1. 5 1
      kernel/modelverse_jit/tree_ir.py

+ 5 - 1
kernel/modelverse_jit/tree_ir.py

@@ -601,7 +601,11 @@ class ReadValueInstruction(StateInstruction):
 
     def simplify(self):
         """Applies basic simplification to this instruction and its children."""
-        return ReadValueInstruction(self.node_id.simplify())
+        simplified_node_id = self.node_id.simplify()
+        if isinstance(simplified_node_id, CreateNodeWithValueInstruction):
+            return simplified_node_id.value
+        else:
+            return ReadValueInstruction(simplified_node_id)
 
     def get_opcode(self):
         """Gets the opcode for this state instruction."""