Skip to content

Commit

Permalink
Fix disable asserts compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
Ansaya committed May 6, 2024
1 parent bc1a3d4 commit cae0a03
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
7 changes: 4 additions & 3 deletions src/HLS/module_allocation/allocation_information.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,9 @@ bool AllocationInformation::is_operation_bounded(const unsigned int index) const
/// currently all the operations introduced after the allocation has been performed are bounded
if(ga)
{
const auto right_kind = ga->op1->get_kind();
#if HAVE_ASSERTS
const auto right_kind = GetPointerS<const gimple_assign>(tn)->op1->get_kind();
#endif
/// currently all the operations introduced after the allocation has been performed are bounded
// BEAWARE: when adding operations here, check they are correctly handled by GetTimeLatency and GetCycleLatency
THROW_ASSERT(GetPointer<const cst_node>(ga->op1) || right_kind == ssa_name_K || right_kind == cond_expr_K ||
Expand Down Expand Up @@ -2337,8 +2339,7 @@ double AllocationInformation::GetPhiConnectionLatency(const unsigned int stateme
double AllocationInformation::GetCondExprTimeLatency(const unsigned int operation_index) const
{
const auto tn = TreeM->GetTreeNode(operation_index);
const auto gp = GetPointer<const gimple_phi>(tn);
THROW_ASSERT(gp, "Tree node is " + STR(tn));
THROW_ASSERT(tn->get_kind() == gimple_phi_K, "Tree node is " + STR(tn));
/// Computing time of cond_expr as time of cond_expr_FU - setup_time
/// In this way we are correctly estimating only phi with two inputs
const auto type = tree_helper::CGetType(tn);
Expand Down
3 changes: 1 addition & 2 deletions src/frontend_analysis/IR_analysis/BitValueIPA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,6 @@ DesignFlowStep_Status BitValueIPA::Exec()
break;
}

const auto fu_signed = signed_var.find(fu_id) != signed_var.cend();
INDENT_DBG_MEX(DEBUG_LEVEL_PEDANTIC, debug_level, "-->Backward");

current.insert(std::make_pair(fu_id, best.at(fu_id)));
Expand Down Expand Up @@ -337,7 +336,7 @@ DesignFlowStep_Status BitValueIPA::Exec()
const auto s = GetPointerS<const ssa_name>(ga->op0);
THROW_ASSERT(IsHandledByBitvalue(ga->op0), "ssa is not handled by bitvalue");
THROW_ASSERT(
tree_helper::IsSignedIntegerType(ga->op0) == fu_signed,
tree_helper::IsSignedIntegerType(ga->op0) == static_cast<bool>(signed_var.count(fu_id)),
"function " +
AppM->CGetFunctionBehavior(caller_id)->CGetBehavioralHelper()->get_function_name() +
" calls function " + fu_name +
Expand Down
8 changes: 4 additions & 4 deletions src/frontend_analysis/IR_analysis/Bit_Value_backward.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,9 @@ std::deque<bit_lattice> Bit_Value::backward_chain(const tree_nodeConstRef& ssa_n
}
else if(user_kind == gimple_return_K)
{
const auto gr = GetPointerS<const gimple_return>(user_stmt);
THROW_ASSERT(gr->op, "ssa id " + STR(ssa_nid) + "used in empty return statement: " + STR(gr));
THROW_ASSERT(GetPointerS<const gimple_return>(user_stmt)->op,
"ssa id " + STR(ssa_nid) +
"used in empty return statement: " + STR(GetPointerS<const gimple_return>(user_stmt)));
const auto res_it = current.find(function_id);
if(res_it != current.end())
{
Expand Down Expand Up @@ -250,15 +251,14 @@ void Bit_Value::backward()
}
if(lhs->get_kind() == ssa_name_K)
{
const auto lhs_ssa = GetPointerS<const ssa_name>(lhs);
if(!IsHandledByBitvalue(lhs))
{
INDENT_DBG_MEX(DEBUG_LEVEL_PEDANTIC, debug_level,
"<--variable " + STR(lhs) + " of type " + STR(tree_helper::CGetType(lhs)) +
" not considered");
continue;
}
INDENT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, "---Propagation for " + lhs_ssa->ToString());
INDENT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, "---Propagation for " + STR(lhs));
auto res = backward_chain(lhs);
if(update_current(res, lhs))
{
Expand Down

0 comments on commit cae0a03

Please sign in to comment.