I'm not quite understanding how one would use the existing alias analysis framework to represent a flow-sensitive analysis. Let's say I have a load and a store and I want to determine whether the load loads from the same place the store stores to. Today we'd do something like this: AA.alias(load->getPointerOperand(), /* get the size */ store->getPointerOperand()), /* size *); There is nothing here that tells AliasAnalyses which program point we're at. It doesn't seem to be enough to say: AA.alias(load, /* size */, store, /* size */); because AliasAnalysis wouldn't know which operands we're interested in. So does AliasAnalysis need an updated interface, something like: virtual AliasResult alias(const Value *V1, unsigned V1Size, const Instruction *V1Inst, const Value *V2, unsigned V2Size, const Instruction *V2Inst); ? Or am I missing something? -Dave
On Aug 18, 2008, at 3:19 PM, David Greene wrote:> I'm not quite understanding how one would use the existing alias > analysis > framework to represent a flow-sensitive analysis.Yep, the current infrastructure isn't set up to support this. I haven't seen a real world case where flow sensitive AA is useful. Normally, the conversion to SSA form is sufficient. Can you talk about cases where this matters to you? -Chris
On Monday 18 August 2008 17:21, Chris Lattner wrote:> On Aug 18, 2008, at 3:19 PM, David Greene wrote: > > I'm not quite understanding how one would use the existing alias > > analysis > > framework to represent a flow-sensitive analysis. > > Yep, the current infrastructure isn't set up to support this. > > I haven't seen a real world case where flow sensitive AA is useful.Yes, in the general case, flow-sensitive AA isn't worth it.> Normally, the conversion to SSA form is sufficient. Can you talk > about cases where this matters to you?Mostly it involves tying into our memory dependence analysis which annotates things on program points. I need a way to translate back to our optimizer data structures. So it's not "flow-sensitive AA" in the strictest sense but it does require program point information. I looked at MemoryDependenceAnalysis and it's not quite what I want. I need to know things like "does this load and store pair interfere," not "give me the most recent instruction that interferes with this memory operation." It's the kinds of things you'd want to ask for scheduling purposes, where no particular instruction ordering is assumed. -Dave