Fix #4857 consider NOT when checking EQ/NEQ under AND/OR tree (#4863)

This commit is contained in:
Yutetsu TAKATSUKASA
2024-01-28 22:36:09 +09:00
committed by GitHub
parent d6f8ccd20b
commit e4a0e5aad6
4 changed files with 70 additions and 4 deletions
+1 -1
View File
@@ -594,7 +594,7 @@ class ConstBitOpTreeVisitor final : public VNVisitorConst {
const V3Number& compNum = constp->num();
auto setPolarities = [this, &compNum](const LeafInfo& ref, const V3Number* maskp) {
const bool maskFlip = isOrTree();
const bool maskFlip = isAndTree() ^ ref.polarity();
int constantWidth = compNum.width();
if (maskp) constantWidth = std::max(constantWidth, maskp->width());
const int maxBitIdx = std::max(ref.lsb() + constantWidth, ref.msb() + 1);