[Bug] Possible issue with the "simplify pass" using the "propagate_knowns_to_simplify_expressions" flag #16577
Labels
needs-triage
PRs or issues that need to be investigated by maintainers to find the right assignees to address it
type: bug
I was trying to understand the use of T.assume in the simplification of expressions and I came across this example in the "test_tir_transform_simplify.py" file named as "TestSimplifyUsingPartiallyKnownBufferExpression". Here, I tried to modify the test and saw that, it was failing while using the "propagate_knowns_to_simplify_expressions" flag and T.assume statements. I have attached the test below.
Here given the assumption statements
T.assume(i < 14 or A[i] == 0)
, A[i] will have to be 0 if the range ofi >= 14
but A[i] may or may not be 0 ifi < 14
. So, we should see the expected code as above where no statement is eliminated. But the IR returned after the pass eliminates the conditionif A[i] == 0
and returns the IR as below :I see that the two flags "propagate_knowns_to_simplify_expressions" and "propagate_knowns_to_prove_conditional " are internally calling the function SimplifyInContext which is simplifying using the line :
expr = control_flow_block.known_at_block_start.SubstituteKnownBufferValues( std::move(expr), axis_var_lookup_, analyzer);
Can you please help to fix the issue with the test or point what modification needs to be done?
According to my understanding there is either an issue with the control flow graph generated when T.assume statement are present or there needs to be slight changes in the SimplifyInContext function which is simplifying the expression, please correct me if I am wrong.
@Lunderberg, it will be helpful if you could help with this issue.
The text was updated successfully, but these errors were encountered: