Prechádzať zdrojové kódy

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

jonathanvdc 8 rokov pred
rodič
commit
a1521fa838
1 zmenil súbory, kde vykonal 5 pridanie a 1 odobranie
  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."""