Unverified Commit dc85aa6b authored by mvermeulen's avatar mvermeulen Committed by GitHub
Browse files

Merge pull request #221 from ROCmSoftwarePlatform/rm_identity

minor fixes to eliminate identity pass
parents 15ba8a36 8f08607e
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
#include <migraphx/instruction.hpp> #include <migraphx/instruction.hpp>
#include <migraphx/operators.hpp> #include <migraphx/operators.hpp>
#include <migraphx/iterator_for.hpp> #include <migraphx/iterator_for.hpp>
#include <migraphx/ranges.hpp>
#include <migraphx/stringutils.hpp> #include <migraphx/stringutils.hpp>
#include <utility> #include <utility>
......
...@@ -11,7 +11,9 @@ inline namespace MIGRAPHX_INLINE_NS { ...@@ -11,7 +11,9 @@ inline namespace MIGRAPHX_INLINE_NS {
struct program; struct program;
/** /**
* Remove identity instructions. * Remove identity instructions. Currently when used as the last pass, it will
* preserve the semantics of previous program state, therefore dead code elimination
* should not be used afterwards.
*/ */
struct eliminate_identity struct eliminate_identity
{ {
......
...@@ -59,7 +59,7 @@ TEST_CASE(simple_test_end_dependency) ...@@ -59,7 +59,7 @@ TEST_CASE(simple_test_end_dependency)
p.add_instruction(sum_op{}, ans, three); p.add_instruction(sum_op{}, ans, three);
p.add_instruction(migraphx::op::identity{}, ans); p.add_instruction(migraphx::op::identity{}, ans);
p.compile(eliminate_identity_target{}); p.compile(eliminate_identity_target{});
EXPECT(!std::none_of(p.begin(), p.end(), [](const migraphx::instruction& ins) { EXPECT(std::any_of(p.begin(), p.end(), [](const migraphx::instruction& ins) {
return ins.name() == "identity"; return ins.name() == "identity";
})); }));
auto result = p.eval({}); auto result = p.eval({});
......
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