[llvm-commits] Teach SCEV about {X,*,Y} recursions

Chris Lattner clattner at apple.com
Wed Apr 23 14:47:30 PDT 2008


On Apr 23, 2008, at 1:58 PM, Török Edwin wrote:

> Hi,
>
> I have a patch that adds support for exponential recursions in loops.
> This is useful in static analysis tools, and also for code  
> optimization.

This is interesting, but a couple questions:

1) What sort of code does this really help with in practice?  I'm a  
bit afraid of adding a bunch of complexity to SCEV analysis if it is  
unlikely to be useful for broad code.  Do you see power sequences  
indexing arrays for example?

2) instead of having SCEVExpander::visitPowExpr emit multiplies, it  
should emit a call to llvm.powi.

3) It would be really nice to teach the code generator to lower  
llvm.powi nicer, particularly before something like this patch goes  
in.  Our current lowering of powi is pretty naive.

-Chris





More information about the llvm-commits mailing list