[TIR][CompactBufferAllocation] Improve upperbound estimation of buffer compaction #12527
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi, this change wants to add some minor updation to region estimator used by buffer compaction:
Add and clearify among
EstimateRegionStrictBound
,EstimateRegionLowerBound
andEstimateRegionUpperBound
Originally we have
EstimateRegionLowerBound
, actually it implements strict bound estimation IMO. Now addupper
andstrict
version for where we actually want them.When estimating upperbounds (eg. in buffer compaction), try estimate each dimension independently when they are dependent accesses where
EstimateRegionLowerBound
is expected to fail.Eg,
A[i, i], 3 < i < 16
fails viaEstimateRegionLowerBound
who check indices be independent. But we can still try best to invoke strict bound analysis on each dimension individually.If range->extent == 1 for
EvalSet(range, dom)
, invokeEvalSet(range->min, dom)
instead.Eg,
EvalSet([k*k, k*k+1), dom_k)
results to [-inf, +inf] due to current algorithm limitation butEvalSet(k*k, dom_k)
results to a range which makes more sense.cc @Hzfengsy @junrushao @junrushao1994 @spectrometerHBH