>>>>> "Archie" == Archie Cobbs <archie at dellroad.org> writes:Archie> Perhaps it is. In which case, I guess we need something better or else Archie> we'll never be able to do certain optimizations. I'm curious to know which optimizations you have in mind. Tom
Tom Tromey wrote:> Archie> Perhaps it is. In which case, I guess we need something better or else > Archie> we'll never be able to do certain optimizations. > > I'm curious to know which optimizations you have in mind.E.g. devirtualization: this requires knowing the Java type (not LLVM type) of an object. But once you compile to LLVM, that information is lost. If e.g. you're loading LLVM pre-compiled modules then you can never do this optimization because you can't recover the Java type information (which is front-end specific). -Archie __________________________________________________________________________ Archie Cobbs * CTO, Awarix * http://www.awarix.com
On Wed, 26 Apr 2006, Archie Cobbs wrote:> Tom Tromey wrote: >> Archie> Perhaps it is. In which case, I guess we need something better or >> else >> Archie> we'll never be able to do certain optimizations. >> >> I'm curious to know which optimizations you have in mind. > > E.g. devirtualization: this requires knowing the Java type (not LLVM type) > of an object. But once you compile to LLVM, that information is lost. > > If e.g. you're loading LLVM pre-compiled modules then you can never > do this optimization because you can't recover the Java type information > (which is front-end specific).You can capture this with front-end specific intrinsics if you like. -Chris -- http://nondot.org/sabre/ http://llvm.org/
>>>>> "Archie" == Archie Cobbs <archie at dellroad.org> writes:Are we bugging the LLVM folks with all this JVM talk? We could find (or make) another list to discuss this. Archie> E.g. devirtualization: this requires knowing the Java type Archie> (not LLVM type) of an object. But once you compile to LLVM, Archie> that information is lost. Archie> If e.g. you're loading LLVM pre-compiled modules then you can Archie> never do this optimization because you can't recover the Java Archie> type information (which is front-end specific). I'm sure you know that precompilation of Java code is already super tricky. To be compatible you have to defer most things anyway. But... I think I don't understand your situation that well. In the JIT, devirtualization looks doable, though somewhat fiddly. At least, that is true for straightforward things like calls to methods in final classes, or calls to methods on objects allocated with 'new' in the current function. (The latter could be done AOT, at least if you defined a way to do the appropriate runtime link; I've considered it for gcj.) Tom