[IR] refactor the verify module. #54895
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR types
New features
PR changes
APIs
Description
新IR的verify重构。
1. Verify函数重构
之前的verify的函数形式是
这种形式的用法是在oepration创建之前其参数进行verify。
但随着pass引入的operation mutation操作,operation在创建之后,也有可能因为mutation操作导致它变得不合法。
因此,本pr将Verify重构为
用法是在oepration创建之后随时可以其进行Verify。这样,pass在对operation进行mutation之后,也可以方便地进行Verify。
2. fluid下Verify函数自动生成模块重构
本pr将paddle/fluid/ir/dialect/下新建 op_verify_gen.py文件。 对op的verify函数生成逻辑进行了模块化分割。
Other
Pcard-67164