[cfe-dev] [LLVMdev] Implementing devirtualization
Benjamin Schulz
bjs428 at mail.missouri.edu
Thu Dec 8 13:46:15 PST 2011
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Vitor,
Just out of curiosity, is there any chance you could provide a link to
your course page or other related information? I've been advocating
that my own CS department start using LLVM as a tool for teaching
compilers, and I'd like an example I could show to the faculty.
Alternately: does anyone else know of a CS department somewhere that's
had success with using LLVM or Clang to teach compilers?
Thanks,
- --Benjamin Schulz
On 12/08/2011 02:04 PM, David Blaikie wrote:
> On Thu, Dec 8, 2011 at 9:56 AM, Vitor Luis Menezes <vitor at utexas.edu> wrote:
>> Hello all,
>>
>> Our compilers class has been using LLVM, and a partner and I decided to
>> implement devirtualization of virtual C++ calls in LLVM as a class project.
>> We quickly realized that existing debug metadata generated by Clang didn't
>> give us enough info to (precisely) implement this, and as such have already
>> begun modifying Clang to insert such metadata. However, for devirtualization
>> we also need to reconstruct the class hierarchy, which we also seek to do
>> through metadata. There appears to be sufficient metadata to do this, but we
>> can't seem to figure out how to actually access this metadata and
>> successfully reconstruct the class hierarchy. Can anyone help with this?
>>
>> We're also open to alternative approaches, but we'd like to stay in LLVM IR
>> as much as possible.
>
> Some of this is already done by LLVM/Clang - do you have particular
> cases that aren't being devirtualized that you want to focus on?
>
> For some brief background reading you might want to take a look at these bugs:
> http://llvm.org/bugs/show_bug.cgi?id=3100
> http://llvm.org/bugs/show_bug.cgi?id=810
>
> Which are things I (& others more experienced than myself) have posted
> some thoughts on. If you're interested in pursuing PR810 then I have
> some code that Nick Lewycky passed on to me involving his experiments
> in this domain. & I'm also going to CC Eric Christopher because he
> mentioned he'd had some thoughts on how to achieve this (the general
> problem described in 810 about how to pass assumptions/facts from the
> frontend to the backend) & I never got around to asking him about the
> details.
>
> This approach should stay even more in LLVM IR than your proposed
> solution of metadata or debug info, but it may have
> limitations/problems that your proposed approach does not - so I
> certainly wouldn't rule anything out just yet.
>
> - David
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJO4TAnAAoJECT8Sbi31ptpN/cH+wXeJxwsXfyLNXHNXnWKU0H5
3qiaanks0mqvCeaSAMgB+ql8k3OWhWoq3tbL4d0zYl0X26osp2Es+WBElHb735M7
4ib9ucGsX4pM2b+mEo3LEcfNVKkJEGhkT+iDEkL5e93SA2gEhwQ+7AUiD/M0Nti0
HxJR7rI2CujLGgMYVO0N0dYsf0gQWUR5hfXy5AuSLwzHDbs9Zd0fKThWOrfzXLd6
rvQmZTw4GOXfVnwsndo7R5kYFVoGN0qLnbkkOEN5asf3tKq9H+qJc8kS8iEEVcMD
Njn1dY6HHrP0/VHD2HKki3s0fGwbvvU2mLTWPYE1cR0Yme8wve7zyNmjBjtsFsg=
=6aei
-----END PGP SIGNATURE-----
More information about the cfe-dev
mailing list