提交 49fdddef 编写于 作者: M Megvii Engine Team 提交者: Xu Xinran

fix(gopt): fix reorder arith chain pass

GitOrigin-RevId: d3257ac43a69d37176896acfebaf1897ca213f05
上级 6742a58b
......@@ -617,6 +617,16 @@ VarNode* ReorderArithChainPass::Impl::reduce_shp2terms(Mode mode) {
}
}
{
// sorted by id(), so the same set of input terms would get the
// same reduced var
auto cmp = [](const ShapedVars::value_type &a,
const ShapedVars::value_type &b) {
return a.second->id() < b.second->id();
};
small_sort(m_const_terms.begin(), m_const_terms.end(), cmp);
small_sort(m_nonconst_terms.begin(), m_nonconst_terms.end(), cmp);
}
merge_shaped_terms(mode, m_const_terms, true);
auto &&all_terms = m_const_terms;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册