| 42 | } |
| 43 | |
| 44 | TEST_CASE(cse_test1) |
| 45 | { |
| 46 | migraphx::module m1; |
| 47 | { |
| 48 | auto one = m1.add_literal(1); |
| 49 | auto two = m1.add_literal(2); |
| 50 | auto sum1 = m1.add_instruction(migraphx::make_op("add"), one, two); |
| 51 | auto sum2 = m1.add_instruction(migraphx::make_op("add"), one, two); |
| 52 | auto sum3 = m1.add_instruction(migraphx::make_op("add"), sum1, sum2); |
| 53 | m1.add_instruction(pass_op{}, sum3); |
| 54 | } |
| 55 | run_pass(m1); |
| 56 | |
| 57 | migraphx::module m2; |
| 58 | { |
| 59 | auto one = m2.add_literal(1); |
| 60 | auto two = m2.add_literal(2); |
| 61 | auto sum1 = m2.add_instruction(migraphx::make_op("add"), one, two); |
| 62 | auto sum3 = m2.add_instruction(migraphx::make_op("add"), sum1, sum1); |
| 63 | m2.add_instruction(pass_op{}, sum3); |
| 64 | } |
| 65 | EXPECT(m1 == m2); |
| 66 | } |
| 67 | |
| 68 | TEST_CASE(cse_test2) |
| 69 | { |
nothing calls this directly
no test coverage detected