forked from github/verilator
DFG: fix REPLACE_EQ_OF_CONST_AND_CONST peephole pattern
This commit is contained in:
parent
cd2a5771b8
commit
17976d7401
@ -610,9 +610,7 @@ class V3DfgPeephole final : public DfgVisitor {
|
|||||||
if (DfgConst* const rhsConstp = rhsp->cast<DfgConst>()) {
|
if (DfgConst* const rhsConstp = rhsp->cast<DfgConst>()) {
|
||||||
APPLYING(REPLACE_EQ_OF_CONST_AND_CONST) {
|
APPLYING(REPLACE_EQ_OF_CONST_AND_CONST) {
|
||||||
DfgConst* const replacementp = makeZero(vtxp->fileline(), 1);
|
DfgConst* const replacementp = makeZero(vtxp->fileline(), 1);
|
||||||
if (lhsConstp->constp()->sameTree(rhsConstp->constp())) {
|
replacementp->num().opEq(lhsConstp->num(), rhsConstp->num());
|
||||||
replacementp->num().setLong(1);
|
|
||||||
}
|
|
||||||
vtxp->replaceWith(replacementp);
|
vtxp->replaceWith(replacementp);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user