Refactor DFG IndependentBits analysis to work for any vertex. (#6209)

This used to be restricted to variable vertices, but now can handle
arbitrary circular vertices that represent packed values. It also
converges faster than the earlier version. Prep for resolving loops
through arrays.
This commit is contained in:
Geza Lore
2025-07-21 19:57:02 +01:00
committed by GitHub
parent 7646e7d89c
commit 7401a8a43a
4 changed files with 78 additions and 56 deletions
+7
View File
@@ -2242,6 +2242,13 @@ V3Number& V3Number::opBufIf1(const V3Number& ens, const V3Number& if1s) {
return *this;
}
// Sets all bits in range to the given value
V3Number& V3Number::opSetRange(uint32_t lsb, uint32_t width, char bitValue) {
const uint32_t msb = lsb + width - 1;
for (uint32_t i = lsb; i <= msb; ++i) setBit(i, bitValue);
return *this;
}
V3Number& V3Number::opAssign(const V3Number& lhs) { return opAssignNonXZ(lhs, false); }
V3Number& V3Number::opAssignNonXZ(const V3Number& lhs, bool ignoreXZ) {
// Note may be a width change during the assign.