Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIR]Fix the crash of the pass RemoveNoOp #13808

Merged
merged 1 commit into from
Jan 19, 2023

Conversation

lightzhan-intellif
Copy link
Contributor

This PR tries to fix the crash of the pass RemoveNoOp when the condition of IfThenElseNode can be statically determined. For example:

  @L.prim_func
  def remove_no_op():
    if True:
      L.evaluate(0)
    else:
      L.evaluate(0)

This case will cause Segment fault error because RemoveNoOp don't cover the case the return of Parent::VisitStmt_ is not a IfThenElseNode, which will result in the stmt.as<IfThenElseNode>() being null.

@tvm-bot
Copy link
Collaborator

tvm-bot commented Jan 19, 2023

Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.

Generated by tvm-bot

@Hzfengsy Hzfengsy changed the title Fix the crash of the pass RemoveNoOp [TIR]Fix the crash of the pass RemoveNoOp Jan 19, 2023
Copy link
Member

@Hzfengsy Hzfengsy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the fixing

@masahi masahi merged commit a75f110 into apache:main Jan 19, 2023
fzi-peccia pushed a commit to fzi-peccia/tvm that referenced this pull request Mar 27, 2023
Fix the crash of the pass RemoveNoOp.

Co-authored-by: lightzhan-intellif <zhan.liang@intellif.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants