You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the code emitted for constraint evaluation by the MASM codegen is very simple but also very inefficient. Basically, for every operation we are loading values from memory, performing the operation, and then saving values back to memory. This happens even if some of the needed values are already on the stack.
We should improve this by building an optimized algebraic expression evaluator. The goal of this evaluator would be: given an algebraic expression and knowing locations of all operands (both on the stack and in memory), output an optimal sequence of MASM code to evaluate the expression. As as side effect, this would also update the information about what is located on the stack.
As a bonus, we could also try to optimize evaluation across multiple expressions - but we can also do this later.
A potential way to implement this would be to have a ConstraintEvalEmitter struct, which would be initialized with a reference to the AlgebraicGraph and information about OOD trace frame location in memory. Then, it could have visit_constraint() method which would take an expression index and a writer. This method would determine the optimal sequence of instructions needed to evaluate the constraint, and would write this sequence into the writer.
The text was updated successfully, but these errors were encountered:
Currently, the code emitted for constraint evaluation by the MASM codegen is very simple but also very inefficient. Basically, for every operation we are loading values from memory, performing the operation, and then saving values back to memory. This happens even if some of the needed values are already on the stack.
We should improve this by building an optimized algebraic expression evaluator. The goal of this evaluator would be: given an algebraic expression and knowing locations of all operands (both on the stack and in memory), output an optimal sequence of MASM code to evaluate the expression. As as side effect, this would also update the information about what is located on the stack.
As a bonus, we could also try to optimize evaluation across multiple expressions - but we can also do this later.
A potential way to implement this would be to have a
ConstraintEvalEmitter
struct, which would be initialized with a reference to theAlgebraicGraph
and information about OOD trace frame location in memory. Then, it could havevisit_constraint()
method which would take an expression index and a writer. This method would determine the optimal sequence of instructions needed to evaluate the constraint, and would write this sequence into the writer.The text was updated successfully, but these errors were encountered: