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

Fix testcase for mul_add that was being prematurely optmized and failing

Original use case of having a literal 1, instead of any other number in simplify_mul_add, resulted in the find_unit_mult_const function to optimize away the literal 1 causing this test to fail. on the final check. Switched the constant to a non zero & one value, and now correctly passes.
parent 49406cee
...@@ -337,7 +337,7 @@ TEST_CASE(simplify_mul_add) ...@@ -337,7 +337,7 @@ TEST_CASE(simplify_mul_add)
migraphx::module m1; migraphx::module m1;
{ {
auto x = m1.add_parameter("x", {migraphx::shape::int32_type, {1}}); auto x = m1.add_parameter("x", {migraphx::shape::int32_type, {1}});
auto one = m1.add_literal(1); auto one = m1.add_literal(3);
auto two = m1.add_literal(2); auto two = m1.add_literal(2);
auto sum = m1.add_instruction(migraphx::make_op("add"), one, x); auto sum = m1.add_instruction(migraphx::make_op("add"), one, x);
auto mul = m1.add_instruction(migraphx::make_op("mul"), sum, two); auto mul = m1.add_instruction(migraphx::make_op("mul"), sum, two);
...@@ -348,7 +348,7 @@ TEST_CASE(simplify_mul_add) ...@@ -348,7 +348,7 @@ TEST_CASE(simplify_mul_add)
migraphx::module m2; migraphx::module m2;
{ {
auto x = m2.add_parameter("x", {migraphx::shape::int32_type, {1}}); auto x = m2.add_parameter("x", {migraphx::shape::int32_type, {1}});
auto one = m2.add_literal(1); auto one = m2.add_literal(3);
auto two = m2.add_literal(2); auto two = m2.add_literal(2);
auto mul1 = m2.add_instruction(migraphx::make_op("mul"), two, x); auto mul1 = m2.add_instruction(migraphx::make_op("mul"), two, x);
auto mul2 = m2.add_instruction(migraphx::make_op("mul"), two, one); auto mul2 = m2.add_instruction(migraphx::make_op("mul"), two, one);
......
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