!15606 [control flow]handle same label id in labelswitch

From: @liangzelang
Reviewed-by: @zhoufeng54,@kisnwang
Signed-off-by: @kisnwang
This commit is contained in:
mindspore-ci-bot 2021-04-25 19:18:25 +08:00 committed by Gitee
commit 94a4a1beac
1 changed files with 2 additions and 1 deletions

View File

@ -1308,13 +1308,14 @@ class ExecuteOrderGenerator {
// Use new label if find repeated label.
if (iter == labels->end()) {
new_labels.emplace_back(label_id);
labels->emplace_back(label_id);
continue;
}
new_labels.emplace_back(++max_label_);
labels_multimap->insert(std::pair<uint32_t, uint32_t>(*iter, max_label_));
labels->emplace_back(max_label_);
is_new_labels = true;
}
labels->insert(labels->end(), new_labels.begin(), new_labels.end());
switch_labels->insert(switch_labels->end(), new_labels.begin(), new_labels.end());
if (is_new_labels) {
AnfAlgo::SetNodeAttr(kAttrLabelSwitchList, MakeValue(new_labels), node);