Samuel Crow wrote:>> From: Andre Tavares <andrelct at dcc.ufmg.br>>> I'm working on a project to remove unnecessary array bound checks in >> Java. For this purpose I will need to use llvm-java. >> >> What is the state of llvm-java? Can someone explain how to build and use it? >> >> I saw some old emails on the list, and some about a SoC 2008 on Java, >> but I didn't find anything regarding its current state and documentation.> LLVM-Java has been rendered obsolete by http://vmkit.llvm.org/ so look into using VMKit instead.Also, if you can make the capability generic enough to use in Shark (more at http://gbenson.net/) that would be very useful. The key, I suspect, is to allow the Java front end mark an array.length field in such a way that LLVM knows that field doesn't alias anything else and is constant, so it can be hoisted out of loops. Andrew.
Hi Andrew, Andrew Haley wrote:> Also, if you can make the capability generic enough to use in Shark > (more at http://gbenson.net/) that would be very useful. > >Agree.> The key, I suspect, is to allow the Java front end mark an array.length > field in such a way that LLVM knows that field doesn't alias anything else > and is constant, so it can be hoisted out of loops. >For that matter, VMKit already has this optimization. Instead of emitting an LLVM load of the size field, VMKit emits a GetArrayLength call, flagged readnone. The GVN pass will merge all GetArrayLength of a same array and the LICM pass will hoist the call. Once theses passes are complete, VMKit lowers the call to the actual load. :) Cheers, Nicolas> Andrew. > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >
Nicolas Geoffray wrote:> Hi Andrew, > > Andrew Haley wrote: >> Also, if you can make the capability generic enough to use in Shark >> (more at http://gbenson.net/) that would be very useful.>> Agree. > >> The key, I suspect, is to allow the Java front end mark an array.length >> field in such a way that LLVM knows that field doesn't alias anything else >> and is constant, so it can be hoisted out of loops. > > For that matter, VMKit already has this optimization. Instead of > emitting an LLVM load of the size field, VMKit emits a GetArrayLength > call, flagged readnone. The GVN pass will merge all GetArrayLength of a > same array and the LICM pass will hoist the call. Once theses passes are > complete, VMKit lowers the call to > the actual load.Right, so that part should be trivial. So, does the array bounds check elimination already work? If it does, that will considerably reduce the work that Andre needs to do. To say the least... Andrew.