1 / 12

LLVM Primer

Rupesh Nasre. Jan 12, 2011. LLVM Primer. Slides and examples available at http://clweb.csa.iisc.ernet.in/nasre/tech/research/. Outline. Introduction Writing a pass Writing an analysis. Introduction. What is LLVM? More information: llvm.org. Is LLVM active?. Current version: 2.8.

manz
Download Presentation

LLVM Primer

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Rupesh Nasre. Jan 12, 2011 LLVM Primer Slides and examples available at http://clweb.csa.iisc.ernet.in/nasre/tech/research/

  2. Outline • Introduction • Writing a pass • Writing an analysis

  3. Introduction • What is LLVM? • More information: llvm.org

  4. Is LLVM active? Current version: 2.8

  5. LLVM reach Used by Adobe, Apple, Cray, NIC, Siemens, Sun, etc. Used in CMU, Ghent, NTU, Rice, Stanford, UC, UIUC, Upenn, Utexas, etc.

  6. Compilation Phases • Frontend: Source -> IR • Optimizations: IR -> IR • Code generation: IR -> x86 In this course

  7. Compilation Phases • Frontend: Source -> IR • Optimizations: IR -> IR • Code generation: IR -> x86 In this talk

  8. Outline • Introduction • Writing a pass • Writing an analysis

  9. Writing a pass • Install: doesn't require root privileges. • LLVM • LLVM-GCC • Compile example to bytecode. • Create the pass • compile to .so • load using opt • run on the example bytecode

  10. Outline • Introduction • Writing a pass • Writing an analysis

  11. Summary • LLVM is a thick forest, you can easily get lost. • After initial warm-up, it is better to look at the documentation on demand-basis. • Use LLVM mailing lists; first search for your question. • It is C++, compilation errors are non-decipherable. • LLVM type system is strong. Avoid a quick type-cast now and you will save 2 hours of debugging tomorrow. • Your assignments would take time: start early.

  12. Rupesh Nasre. nasre@csa.iisc.ernet.in Jan 12, 2011 LLVM Primer

More Related