diff options
author | Eddie Hung <eddie@fpgeh.com> | 2019-08-22 16:57:59 -0700 |
---|---|---|
committer | Eddie Hung <eddie@fpgeh.com> | 2019-08-22 16:57:59 -0700 |
commit | fe1b2337fd7950e1d563be5b8ccbaa81688261e4 (patch) | |
tree | 55f287bb3ae90dcbdd630455bd5e0269dc247070 | |
parent | c50d68653d093a8daa47f589836e6178be82b54f (diff) | |
download | yosys-fe1b2337fd7950e1d563be5b8ccbaa81688261e4.tar.gz yosys-fe1b2337fd7950e1d563be5b8ccbaa81688261e4.tar.bz2 yosys-fe1b2337fd7950e1d563be5b8ccbaa81688261e4.zip |
Do not propagate mem2reg attribute through to result
-rw-r--r-- | frontends/ast/simplify.cc | 3 | ||||
-rw-r--r-- | tests/various/mem2reg.ys | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc index 8493aa513..86dd80c65 100644 --- a/frontends/ast/simplify.cc +++ b/frontends/ast/simplify.cc @@ -151,7 +151,8 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage, reg->is_reg = true; reg->is_signed = node->is_signed; for (auto &it : node->attributes) - reg->attributes.emplace(it.first, it.second->clone()); + if (it.first != ID(mem2reg)) + reg->attributes.emplace(it.first, it.second->clone()); reg->filename = node->filename; reg->linenum = node->linenum; children.push_back(reg); diff --git a/tests/various/mem2reg.ys b/tests/various/mem2reg.ys index 00389c700..85d6267c5 100644 --- a/tests/various/mem2reg.ys +++ b/tests/various/mem2reg.ys @@ -11,3 +11,4 @@ proc cd top select -assert-count 1 m:data1 a:src=<<EOT:4 %i select -assert-count 2 w:data2[*] a:src=<<EOT:5 %i +select -assert-none a:mem2reg |