Should not incorporate if the fg has bprop function.

pull/7673/head
Zhang Qinghua 4 years ago
parent 3763e201b5
commit 40a4a53209

@ -130,7 +130,7 @@ class IncorporateGetitem : public AnfVisitor {
AnfNodePtr operator()(const OptimizerPtr &, const AnfNodePtr &node) override { AnfNodePtr operator()(const OptimizerPtr &, const AnfNodePtr &node) override {
Reset(); Reset();
AnfVisitor::Match(prim::kPrimTupleGetItem, {IsCNode, IsValueNode<Int32Imm>})(node); AnfVisitor::Match(prim::kPrimTupleGetItem, {IsCNode, IsValueNode<Int32Imm>})(node);
if (node->func_graph() == nullptr || idx_ == -1 || fg_ == nullptr) { if (node->func_graph() == nullptr || idx_ == -1 || fg_ == nullptr || fg_->has_flag(FUNC_GRAPH_FLAG_DEFER_INLINE)) {
return nullptr; return nullptr;
} }
@ -361,7 +361,7 @@ class IncorporateGetitemSwitch : public AnfVisitor {
is_in_get_ = false; is_in_get_ = false;
auto fg = node->func_graph(); auto fg = node->func_graph();
if (idx_ == -1 || switch_ == nullptr || fg == nullptr) { if (idx_ == -1 || switch_ == nullptr || fg == nullptr || fg->has_flag(FUNC_GRAPH_FLAG_DEFER_INLINE)) {
return nullptr; return nullptr;
} }

Loading…
Cancel
Save