!16662 dont't eliminate cast when cast is input of return

From: @Margaret_wangrui
Reviewed-by: @hwhewei,@zh_qh
Signed-off-by: @hwhewei
This commit is contained in:
mindspore-ci-bot 2021-05-21 09:58:19 +08:00 committed by Gitee
commit 70e6f84458
1 changed files with 1 additions and 2 deletions

View File

@ -470,8 +470,7 @@ bool IsNotRealUsedByOthers(const FuncGraphPtr &graph, const AnfNodePtr &node) {
auto out_node = output.first;
auto name = AnfAlgo::GetCNodeName(out_node);
if (name == prim::kPrimDepend->name() || name == prim::kPrimMakeTuple->name() ||
name == prim::kPrimTupleGetItem->name() || name == prim::kPrimLoad->name() ||
name == prim::kPrimReturn->name()) {
name == prim::kPrimTupleGetItem->name() || name == prim::kPrimLoad->name()) {
auto result = IsNotRealUsedByOthers(graph, out_node);
if (!result) {
return result;