Commit 5d998fb2 authored by charlie's avatar charlie
Browse files

progress

parent 3c160a3f
...@@ -131,10 +131,24 @@ struct find_const_4in_slice ...@@ -131,10 +131,24 @@ struct find_const_4in_slice
} }
}; };
/**
* Find allocate into reshape instructions that can be simplified to a static reshape.
* Example:
* x = allocate(constant_dims) -> reshape(input_data, x)
*/
struct find_static_reshape
{
auto matcher const {return match::name("allocate")(match::nargs(1), }
};
void simplify_dyn_ops::apply(module& m) const void simplify_dyn_ops::apply(module& m) const
{ {
match::find_matches( match::find_matches(m,
m, find_static_2in_broadcasts{}, find_const_3in_slice{}, find_const_4in_slice{}); find_static_2in_broadcasts{},
find_static_alloc_reshape,
find_const_3in_slice{},
find_const_4in_slice{});
match::find_matches(m, find_static_reshape);
} }
} // namespace MIGRAPHX_INLINE_NS } // namespace MIGRAPHX_INLINE_NS
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment