fix FIND_PRIVATE_ARRAYS

This commit is contained in:
2025-12-19 01:55:23 +03:00
parent 3de06d9261
commit f07bea4980
9 changed files with 381 additions and 21 deletions

View File

@@ -64,18 +64,13 @@ static vector<ArrayDimension> DimensionDifference(const ArrayDimension& dim1, co
result.push_back({ dim1.start, dim1.step, (intersection->start - dim1.start) / dim1.step, dim1.array});
/* add the parts between intersection steps */
uint64_t start = (intersection->start - dim1.start) / dim1.step;
uint64_t interValue = intersection->start;
for (int64_t i = start; dim1.start + i * dim1.step <= intersection->start + intersection->step * (intersection->tripCount - 1); i++)
if (intersection->step > dim1.step)
{
uint64_t centerValue = dim1.start + i * dim1.step;
if (centerValue == interValue)
uint64_t start = (intersection->start - dim1.start) / dim1.step;
uint64_t interValue = intersection->start;
for (int64_t i = start; interValue <= intersection->start + intersection->step * (intersection->tripCount - 1); i++)
{
if (i - start > 1)
{
result.push_back({ dim1.start + (start + 1) * dim1.step, dim1.step, i - start - 1, dim1.array });
start = i;
}
result.push_back({interValue + dim1.step, dim1.step, intersection->step / dim1.step, dim1.array});
interValue += intersection->step;
}
}
@@ -216,6 +211,10 @@ void AccessingSet::Insert(const vector<ArrayDimension>& element)
}
AccessingSet AccessingSet::Union(const AccessingSet& source) {
if (source.GetElements().empty())
return *this;
if (allElements.empty())
return source;
AccessingSet result;
for (auto& element : source.GetElements())
result.Insert(element);