Open Quuxplusone opened 6 years ago
GlobalISel should be able to use MachineInstr::mayAlias just like the MI scheduler does, but I guess that isn't really the question?
If you're trying to figure out dependencies, you have essentially same options we have for IR, I think: a uncached backwards scan (like instcombine in certain places), something like MemoryDependenceAnalysis, or something like MemorySSA.
Yes, I'm interested in a sort of efficient cache (that perhaps we can maintain as an analysis?) throughout the pipeline. I'd like to avoid walking the entire CFG if possible for each query.
Load/store ordering needs some thought, as we currently don’t have a way to easily check at the MI level what the ordering requirements are on a set of memory operations. SelectionDAG uses the chains to ensure that they’re scheduled to respect the orderings. How to achieve the same thing remains an open question for GlobalISel.