Attach range information to MMO while translating Loads.
How does this work if it's split into multiple register? I would assume this needs to be decomposed and only trivially valid if there is one result register
Yes - that's how I stumbled on this.
We have an out of tree port of most of DAG's ComputeKnownBits and SimplifyDemandedBits already implemented. It hasn't been upstreamed yet because
- There was no need until now.
- Writing tests were/are pain and are dependent on combines which upstream didn't have a lot of.
I'd be happy to create a patch for that assuming we decide to go down the route of a direct port of DAG like implementation.
@paquette is going to look at this from a design perspective but we haven't so far had a strong immediate need or the time to do this.
My thoughts are that computeKnownBits in SelectionDAG is a potentially very costly analysis, and we currently have magic recursion depth limits to prevent extremely long compile times. We don't have any evidence to support an alternative yet, but it would be nice to prototype different approaches for the GlobalISel equivalent. Maybe add caching support for the start, and/or implement it using a bottom up approach.
For now, I would be happy with the interface that handles the most trivial cases so I can use it in code I’m porting so I don’t have to think about it later. Having it functionally complete is less important