Commit a91071cf authored by Paul's avatar Paul
Browse files

Format

parent baee674c
......@@ -38,8 +38,7 @@ migraphx::instruction* as_address(const instruction_ref& ins) noexcept;
struct compare_instruction_ref
{
bool operator()(const instruction_ref& x,
const instruction_ref& y) const noexcept
bool operator()(const instruction_ref& x, const instruction_ref& y) const noexcept
{
return as_address(x) < as_address(y);
}
......
......@@ -559,7 +559,8 @@ struct find_splits
return true;
}
static std::vector<instruction_ref> split_nary(const std::vector<instruction_ref>& group, bool commutative)
static std::vector<instruction_ref> split_nary(const std::vector<instruction_ref>& group,
bool commutative)
{
// All inputs have the same slices
if(not std::all_of(group.begin(), group.end(), [](auto ins) {
......@@ -583,14 +584,13 @@ struct find_splits
return result;
};
auto inputs = get_inputs(start);
if (commutative and inputs.size() > 1)
if(commutative and inputs.size() > 1)
{
std::sort(inputs.begin(), inputs.end(), compare_instruction_ref{});
if(not std::all_of(group.begin(), group.end(), [&](auto ins) {
auto inputs2 = get_inputs(ins);
std::sort(inputs2.begin(), inputs2.end(), compare_instruction_ref{});
return inputs == inputs2;
}))
return {};
}
......
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