Commit 58681660 authored by Paul's avatar Paul
Browse files

Remove builtins with dce

parent 6b80ea7a
...@@ -16,8 +16,8 @@ void dead_code_elimination::apply(program& p) const ...@@ -16,8 +16,8 @@ void dead_code_elimination::apply(program& p) const
if(ins == p.begin()) if(ins == p.begin())
continue; continue;
const auto i = std::prev(ins); const auto i = std::prev(ins);
// Skip instruction with empty shape as output // Skip instruction with empty shape as output unless its a builtin
if(i->result.elements() == 0) if(i->result.elements() == 0 and not(i->op.name().front() == '@'))
continue; continue;
// Skip the last instruction // Skip the last instruction
if(i == last) if(i == last)
......
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