-
Notifications
You must be signed in to change notification settings - Fork 11k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mlir] DialectConversion: avoid double-free when rolling back op crea…
…tion Dialect conversion infrastructure may roll back op creation by erasing the operations in the reverse order of their creation. While this guarantees uses of values will be deleted before their definitions, this does not guarantee that a parent operation will not be deleted before its child. (This may happen in case of block inlining or if child operations, such as terminators, are created in the parent's `build` function before the parent itself.) Handle the parent/child relationship between ops by removing all child ops from the blocks before erasing the parent. The child ops remain live, detached from a block, and will be safely destroyed in their turn, which may come later than that of the parent. Differential Revision: https://reviews.llvm.org/D80134
- Loading branch information
Showing
4 changed files
with
63 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters