[LLVMdev] alias information on machine instructions

Chris Lattner sabre at nondot.org
Thu Jun 21 16:57:21 PDT 2007


On Mon, 18 Jun 2007, Dan Gohman wrote:
> It probably wouldn't be difficult to teach the basic alias analysis how
> to dig past adds and casts to find base expressions. Or, make the
> CodeGenPrepare pass use getelementptrs directly instead of expanding
> addressing into integer operations. Or maybe instcombine could be run
> after CodeGenPrepare so it could fold the integer operations into
> getelementptrs?

Running instcombine is probably a bad idea, because it makes all sorts of 
transformations (e.g. constant folding casts) that can undo things 
carefully done by codegenprepare and lsr.


> I think the long-term solution is to teach the SelectionDAG framework
> how to look beyond basic-block boundaries so that CodeGenPrepare doesn't
> have to do this de-hoisting of addressing.

yes yes yes, absolutely.

> It also might make sense to write a SCEV-based AliasAnalysis some day.

That would be interesting as well, we could even hook dependence analysis 
up to it so that we could prove A[i] and A[j] don't alias etc.

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/



More information about the llvm-dev mailing list