On 1/17/26 07:51, Richard Biener wrote:
On Fri, Jan 16, 2026 at 10:45 PM Andrew MacLeod <[email protected]> wrote:I've been enhancing prange to track points to information. My current patch set tracks everything that the side tables in VRP use to, and VRP is now using that instead If we see: char buf1[64]; buf2_9 = &buf1 + 12; prange will provide a range like: [prange] char * [1, +INF] -> &MEM <char[64]> [(void *)&buf1 + 12B] Next, I'd like to see if we can use that to replace all the pointer_query infrastructure, making it redundant and removable... and hopefully provide more consistency to it's clients. Given a generic expression, pointer_query seems to primarily provide a base reference, offset range and size range for the expression. So given a generic expression like the above: &MEM <char[64]> [(void *)&buf1 + 12B] I'm looking for "base" = &buf1, offset = 12, and size = 64 or something to that effect. Forget ranges for the moment.. I want to get the constants extracted from an expression. Do we have routines that do this generally? I see tree-dfa.cc::get_ref_base_and_extent () kinda sorta does it, but I'm also interested in other kinds of expressions, not just a MEM. It looks like some of this info is buried within pointer_query.cc but I was wondering if we do it elsewhere more generally. My longer term goal would be to use ranger to track the offsets and suchwithin prange as assignments are made and then we can use the info at appropriate times. ie: _5 = (sizetype) offset_8(D); buf2_10 = &buf1 + _5;There is tree-affine.cc which handles expanding also variable offsets and there's some tools in SCEV/data-dependence analysis but that's mostly for loops.
oooo, tree-affine.cc has some nice stuff in it. Just what I need. Thanks! Andrew
