1
0
mirror of synced 2026-04-24 19:40:49 +00:00

Do not propagate mem2reg attribute through to result

This commit is contained in:
Eddie Hung
2019-08-22 16:57:59 -07:00
parent c50d68653d
commit fe1b2337fd
2 changed files with 3 additions and 1 deletions

View File

@@ -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);

View File

@@ -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