forked from mindspore-Ecosystem/mindspore
incoroprate TupleGetItem Switch if EnvSetItem or EnvGetItem exists in the same func graph, so EnvGetItem or EnvSetItem can be eliminated even DEFER_INLINE flag is set, so before second order J is expanded, EnvGetItem or EnvSetItem is eliminated
This commit is contained in:
parent
0bd1e34a4d
commit
3f2a08c1d0
|
@ -362,7 +362,8 @@ class IncorporateGetitemSwitch : public AnfVisitor {
|
|||
is_in_get_ = false;
|
||||
|
||||
auto fg = node->func_graph();
|
||||
if (idx_ == -1 || switch_ == nullptr || fg == nullptr || fg->has_flag(FUNC_GRAPH_FLAG_DEFER_INLINE)) {
|
||||
if (idx_ == -1 || switch_ == nullptr || fg == nullptr ||
|
||||
(fg->has_flag(FUNC_GRAPH_FLAG_DEFER_INLINE) && !ExistEnvNode(fg))) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue