Rewrite inplace pass and fix gc bug#17126
Conversation
test=develop
test=develop
d6c5ac8 to
028e920
Compare
test=develop
028e920 to
0a47464
Compare
There was a problem hiding this comment.
Tiny Grammar issue: "each other name" should be "each other's name"
There was a problem hiding this comment.
Oh >.< , I meant "avoid optimizing the variable ..."
There was a problem hiding this comment.
I saw you did Op()->Flush() after renaming at this function above. Do we need to do Flush() after renaming here?
| std::unique_ptr<ir::Graph> test_SingleOpInplaceInToOut( | ||
| std::unique_ptr<ir::Graph> g) { | ||
| std::unique_ptr<details::InplacePass> pass(new details::InplacePass()); | ||
| auto pass = ir::PassRegistry::Instance().Get("inplace_pass"); |
There was a problem hiding this comment.
"auto pass = CreateInplacePass()" to de-duplicate code?
| std::queue<OpHandleBase *> q; | ||
| std::unordered_set<OpHandleBase *> visited; | ||
| q.push(op); | ||
| do { |
There was a problem hiding this comment.
Prefer "while" loop than "do while" loop.
There is q.push(op) before the while loop. It's no harm to write
while (!q.empty()) {
...
}
| @@ -65,6 +65,7 @@ bool OpGraphView::VisitAllPendingOps(OpHandleBase *op, | |||
| if (!callback(pending_op)) { | |||
| return false; | |||
| } | |||
There was a problem hiding this comment.
Prefer "while" loop than "do while" loop.
There is q.push(op) before the while loop. It's no harm to write
while (!q.empty()) {
...
}
zhhsplendid
left a comment
There was a problem hiding this comment.
LGTM but please change the "avoid doing optimize" to "avoid optimizing" which I commented.
c26671f to
4765b61
Compare
|
@zhhsplendid Thanks. I have change "avoid dong optimize" to be "avoid optimizing". |
No description provided.