Skip to content

Commit

Permalink
Adds additional cases for remove_redundant_buf optimization (#682)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjalander authored Dec 25, 2024
1 parent e59773a commit 39c662b
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions jlm/hls/backend/rvsdg2rhls/remove-redundant-buf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,33 @@ eliminate_buf(jlm::rvsdg::output * o)
if (auto so = dynamic_cast<jlm::rvsdg::simple_output *>(o))
{
auto node = so->node();
if (dynamic_cast<const branch_op *>(&node->GetOperation()))
if (jlm::rvsdg::is<const branch_op>(node->GetOperation()))
{
return eliminate_buf(node->input(1)->origin());
}
else if (dynamic_cast<const local_load_op *>(&node->GetOperation()))
else if (jlm::rvsdg::is<const jlm::hls::fork_op>(node->GetOperation()))
{
// part of memory disambiguation
return eliminate_buf(node->input(0)->origin());
}
else if (jlm::rvsdg::is<const local_load_op>(node->GetOperation()))
{
return true;
}
else if (jlm::rvsdg::is<const local_store_op>(node->GetOperation()))
{
return true;
}
else if (dynamic_cast<const local_store_op *>(&node->GetOperation()))
else if (jlm::rvsdg::is<const jlm::hls::load_op>(node->GetOperation()))
{
return true;
}
else if (jlm::rvsdg::is<const jlm::hls::store_op>(node->GetOperation()))
{
return true;
}
}

return false;
}

Expand Down

0 comments on commit 39c662b

Please sign in to comment.