Skip to content

Commit

Permalink
Remove legacy header and bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Bo-Yuan-Huang committed Jul 20, 2020
1 parent a49d7bd commit 6ade47f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 251 deletions.
10 changes: 5 additions & 5 deletions include/ilang/ila/ast/expr_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ class ExprOpEq : public ExprOp {
const std::string& suffix) const;
}; // class ExprOpEq

// Not equal is implemented in ExprFuse with Eq and Not.
// Not equal is implemented in asthub with Eq and Not.

/// \brief The class wrapper for binary comparison signed less than "<".
class ExprOpLt : public ExprOp {
Expand All @@ -308,9 +308,9 @@ class ExprOpGt : public ExprOp {
const std::string& suffix) const;
}; // class ExprOpGt

// Signed less than or equal to is implemented in ExprFuse with Eq and Lt.
// Signed less than or equal to is implemented in asthub with Eq and Lt.

// Signed greater than or equal to is implemented in ExprFuse with Eq and Gt.
// Signed greater than or equal to is implemented in asthub with Eq and Gt.

/// \brief The class wrapper for binary comparison unsigned less than.
class ExprOpUlt : public ExprOp {
Expand All @@ -332,9 +332,9 @@ class ExprOpUgt : public ExprOp {
const std::string& suffix) const;
}; // class ExprOpUgt

// Unsigned less than or equal to is implemented in ExprFuse with Eq and ULt.
// Unsigned less than or equal to is implemented in asthub with Eq and ULt.

// Unsigned greater than or equal to is implemented in ExprFuse with Eq and UGt.
// Unsigned greater than or equal to is implemented in asthub with Eq and UGt.

/******************************************************************************/
// Memory
Expand Down
227 changes: 0 additions & 227 deletions include/ilang/ila/expr_fuse.h

This file was deleted.

14 changes: 5 additions & 9 deletions src/ila-mngr/p_rewrite_conditional_store.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,8 @@ class FuncObjRewrCondStore : public FuncObjRewrExpr {

auto IsStore = [=](const ExprPtr& x) {
ILA_ASSERT(x && x->is_mem()) << "Invariant violation " << x;
if (x->is_op()) {
return asthub::GetUidExprOp(x) == AstUidExprOp::kStore;
}
return false;
return (x->is_op()) ? (asthub::GetUidExprOp(x) == AstUidExprOp::kStore)
: false;
};

// pattern 0 - identical branch
Expand Down Expand Up @@ -114,11 +112,9 @@ bool RewriteConditionalStore(const InstrLvlAbsPtr& m) {

auto func = FuncObjRewrCondStore();
auto Rewr = [=, &func](const ExprPtr& e) {
if (e) {
e->DepthFirstVisitPrePost(func);
return func.get(e);
}
return e;
ILA_NOT_NULL(e);
e->DepthFirstVisitPrePost(func);
return func.get(e);
};

return RewriteGeneric(m, Rewr);
Expand Down
18 changes: 8 additions & 10 deletions src/ila/instr_lvl_abs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,11 @@ void InstrLvlAbs::AddInput(const ExprPtr& input_var) {
// sanity check
ILA_NOT_NULL(input_var);
ILA_ASSERT(input_var->is_var()) << "Register non-var to Inputs.";
// should be the first

auto name = input_var->name();
auto posi = inputs_.find(name);
auto poss = states_.find(name);
ILA_ASSERT(posi == inputs_.end() && poss == states_.end())
<< "Input variable " << input_var << " has been declared.";
ILA_ASSERT(inputs_.find(name) == inputs_.end()) << name;
ILA_ASSERT(states_.find(name) == states_.end()) << name;

// register to the simplifier
auto var = Unify(input_var);
// register to Inputs
Expand All @@ -87,12 +86,11 @@ void InstrLvlAbs::AddState(const ExprPtr& state_var) {
// sanity check
ILA_NOT_NULL(state_var);
ILA_ASSERT(state_var->is_var()) << "Register non-var to States.";
// should be the first

auto name = state_var->name();
auto poss = states_.find(name);
auto posi = inputs_.find(name);
ILA_ASSERT(poss == states_.end() && posi == inputs_.end())
<< "State variable " << state_var << " has been declared.";
ILA_ASSERT(inputs_.find(name) == inputs_.end());
ILA_ASSERT(states_.find(name) == states_.end());

// register to the simplifier
auto var = Unify(state_var);
// register to States
Expand Down

0 comments on commit 6ade47f

Please sign in to comment.