yangulei commented on PR #13213:
URL: https://github.com/apache/tvm/pull/13213#issuecomment-1294245607

   The pattern with `constant inputs` is fine for the first iteration in 
`SimplifyExpr` pass. While starting from the second iteration, some `constant 
inputs` are rewritten to `constant expr inputs`.
   
   Take `((x + c1) + c2 )+ c3` as an example, first iteration could rewrite it 
to `(x + (c1 + c2)) + c3`. Now the first `add` becomes `x+(c1 + c2)`, with an 
**input which could evaluate to a constant** instead of a **constant input**, 
so the pattern with `constant inputs` will not match. I think this could be 
solved by evaluating `c1 + c2` to a constant like `c_12` at the end of the 
first iteration.
   
   Is there a way to evaluate the `constant expr` to some concrete `constant` 
in the `SimplifyExpr` pass? If we can do that, the input graph for the later 
iterations also matches the `constant inputs` pattern and the simplification 
will carry on.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to