Commit fad4da8a authored by Ted Themistokleous's avatar Ted Themistokleous
Browse files

Remove the use of add_outline and use literal instead

outline seems to be bugged, and going to be depreciated, thus switching to
creating a new literal with the proper shape for the empty output branch.
parent cd9560ed
......@@ -128,8 +128,9 @@ struct parse_if : op_parser<parse_if>
}
auto handle_empty_branch = [](module_ref& mdl, const shape& out_shape) {
auto outline_ins = mdl->add_outline(out_shape);
mdl->replace_return({outline_ins});
shape gen_shape(out_shape.type(), out_shape.lens(), out_shape.strides());
auto literal_ins = mdl->add_literal(gen_shape, gen_shape.lens());
mdl->replace_return({literal_ins});
return out_shape.lens();
};
......
......@@ -2600,8 +2600,9 @@ TEST_CASE(if_then_empty_constant_test)
auto* then_mod = p.create_module("If_4_if");
then_mod->add_literal(migraphx::shape::int64_type);
auto outline = then_mod->add_outline(s);
then_mod->add_return({outline});
migraphx::shape gen_s{s.type(), s.lens(), s.strides()};
auto then_lit = then_mod->add_literal(gen_s, gen_s.lens());
then_mod->add_return({then_lit});
auto* else_mod = p.create_module("If_4_else");
auto re = else_mod->add_instruction(migraphx::make_op("mul"), y, l2);
......@@ -2633,8 +2634,9 @@ TEST_CASE(if_else_empty_constant_test)
auto* else_mod = p.create_module("If_4_else");
else_mod->add_literal(migraphx::shape::int64_type);
auto outline = else_mod->add_outline(s);
else_mod->add_return({outline});
migraphx::shape gen_s{s.type(), s.lens(), s.strides()};
auto else_lit = else_mod->add_literal(gen_s, gen_s.lens());
else_mod->add_return({else_lit});
auto ret = mm->add_instruction(migraphx::make_op("if"), {cond}, {then_mod, else_mod});
auto r = mm->add_instruction(migraphx::make_op("get_tuple_elem", {{"index", 0}}), ret);
......
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