mirror of https://github.com/YosysHQ/yosys.git
Only set MEM2REG_FL_CONST_LHS/MEM2REG_FL_VAR_LHS for non-init writes, fixes #867
Signed-off-by: Clifford Wolf <clifford@clifford.at>
This commit is contained in:
parent
ef48b62cb1
commit
ab5b50ae3c
|
@ -2954,13 +2954,15 @@ void AstNode::mem2reg_as_needed_pass1(dict<AstNode*, pool<std::string>> &mem2reg
|
||||||
proc_flags[mem] |= AstNode::MEM2REG_FL_EQ1;
|
proc_flags[mem] |= AstNode::MEM2REG_FL_EQ1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// remember if this is a constant index or not
|
// for proper (non-init) writes: remember if this is a constant index or not
|
||||||
|
if ((flags & MEM2REG_FL_INIT) == 0) {
|
||||||
if (children[0]->children.size() && children[0]->children[0]->type == AST_RANGE && children[0]->children[0]->children.size()) {
|
if (children[0]->children.size() && children[0]->children[0]->type == AST_RANGE && children[0]->children[0]->children.size()) {
|
||||||
if (children[0]->children[0]->children[0]->type == AST_CONSTANT)
|
if (children[0]->children[0]->children[0]->type == AST_CONSTANT)
|
||||||
mem2reg_candidates[mem] |= AstNode::MEM2REG_FL_CONST_LHS;
|
mem2reg_candidates[mem] |= AstNode::MEM2REG_FL_CONST_LHS;
|
||||||
else
|
else
|
||||||
mem2reg_candidates[mem] |= AstNode::MEM2REG_FL_VAR_LHS;
|
mem2reg_candidates[mem] |= AstNode::MEM2REG_FL_VAR_LHS;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// remember where this is
|
// remember where this is
|
||||||
if (flags & MEM2REG_FL_INIT) {
|
if (flags & MEM2REG_FL_INIT) {
|
||||||
|
|
Loading…
Reference in New Issue