GSoC - Range Analysis

Hi John,

> Regarding your comment about Java, I think you're correct that your
> range analysis would be better at optimizing Java code. However,
> LLVM really isn't used for Java, so I'm not sure if that's a strong
> argument for your proposal. To get the best bang for the buck, I
> think your analysis will need to work well in optimizing
> C/C++/Objective-C[++] code.

I use LLVM for compiling Ada. Ada turns into LLVM IR which is
chock-a-block full of range checks, so this analysis might be helpful
for Ada.

> One thing you could do to mitigate that problem is to do an
> experiment that *shows* that your analysis has the potential to
> find more optimization opportunities than what LLVM does today.
> For example, for dead code elimination, you could run your analysis
> on optimized LLVM bitcode and find the percentage of icmp/fcmp
> instructions that can be changed into constants. If you find a
> large percentage, then it is more likely that your analysis will
> help dead code elimination or other optimizations.

In short, if you can speed up important programs using your analysis
then that would be a great selling point.

Is it possible to use something like your range analysis on
floating-point values? I can certainly see a large performance benefit
coming from showing that some instructions will always have finite
values, thus allowing 'finite math' optimizations.

-Hal