[LLVMdev] Removing redundant type checks from Java

Alysson aishofpf at gmail.com
Mon Sep 21 13:56:47 PDT 2009


Hi, LLVMers,

    I am a CS student in my final year, and I would like to use LLVM in my
final course project. So, I just download LLVM and VMKit, and I have been
playing with both. I can produce llvm bytecodes from java programs, and now
my idea is to remove redundant type checks from the code. For instance, if
we consider a program like this:

if (o instanceof A) {
  A a = (A) o;
  // do something with a
}

we see that Java will put a type test before the cast, but this test is
unnecessary, as we already know that we have passed the instanceof test. So,
as my project I would like to remove these redundant tests. My questions:

1) Has this already been done by some of the VMKit optimizing passes?
2) If not, is this feasible?
3) Is this the right list to ask questions about VMKit?

All the best,

Alysson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090921/dca4e80d/attachment.html>


More information about the llvm-dev mailing list