From 5e5b5ab69d505c13222856b160d4a8d951efbb73 Mon Sep 17 00:00:00 2001 From: Geza Lore Date: Sun, 15 Jun 2025 23:10:42 +0100 Subject: [PATCH] Restrict Dfg PUSH_SEL_THROUGH_CONCAT pattern (#6092) This pattern is bit dubious and can blow up the size of the logic. Restrict it to only apply if it strictly does not increase DFG size. --- src/V3DfgPeephole.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/V3DfgPeephole.cpp b/src/V3DfgPeephole.cpp index cd1915f06..ead99f657 100644 --- a/src/V3DfgPeephole.cpp +++ b/src/V3DfgPeephole.cpp @@ -774,12 +774,9 @@ class V3DfgPeephole final : public DfgVisitor { DfgSel* const replacementp = make(vtxp, lhsp, lsb - rhsp->width()); replace(vtxp, replacementp); } - } else if (lsb == 0 || msb == concatp->width() - 1 // - || lhsp->is() || rhsp->is() // - || !concatp->hasMultipleSinks()) { - // If the select straddles both sides, but at least one of the sides is wholly - // selected, or at least one of the sides is a Const, or this concat has no other - // use, then push the Sel past the Concat + } else if (!concatp->hasMultipleSinks()) { + // If the select straddles both sides, the Concat has no other use, + // then push the Sel past the Concat APPLYING(PUSH_SEL_THROUGH_CONCAT) { const uint32_t rSelWidth = rhsp->width() - lsb; const uint32_t lSelWidth = width - rSelWidth;