Instrumentation of Clang/LLVM for Compile Time

Description of the project: Every developer, at some point (usually while waiting for their program to compile), has asked “Why is it taking so long?” This project is to seek an answer to this question. There exists within LLVM, and by extension CLANG, a timing infrastructure that records events within the compiler. However, its utilization is inconsistent and insufficient. This can be improved by adding more instrumentation throughout LLVM and CLANG but one must be careful. Too much instrumentation, or instrumenting the wrong things, can be confusing and overwhelming, thus making it no more useful than not enough information. The trick is to find the right places to instrument and controlling the instrumentation. Seeking out these key spots will take you through the entire compilation process, from preprocessing through to final code generation, and all phases between. As you instrument the code, you will look at the data as you evolve it, which will further direct your search. You will develop new ways to control and filter the information to allow a better understanding of where the compiler is spending its time. You will seek out and develop example test inputs that illustrate where the compiler can be improved, which will in turn, help direct your instrumenting and search. You will consider and develop ways of controlling the instrumentation to allow better understanding and detailed examination of phases of compilation. Through all of this, you will gain an understanding of how a compiler works, from front end processing, through the LLVM optimization pipeline, through to code generation. You will see, and understand, the big picture of what is required to compile and optimize a C/C++ program, and in particular, how CLANG, LLVM and LLC accomplish these tasks. Your mentors have a combined experience of approximately 25 years of compiler development and around 8 years of experience with LLVM itself to help you on your quest.

Expected results:

  • Targetted expansion of the use of the existing timing infrastructure
  • Identification of appropriate test inputs for improving compile time
  • Identification of compile time hotspots
  • New and improved methods of controlling the timing infrastructure

Confirmed Mentor: @Jamie , @whitneywhtsang

Desirable skills: C++ programming skills; CLANG/LLVM knowledge an asset but not necessary; self motivated; curiosity; desire to learn

Related discourse topic: Regarding Instrumentation of Clang/LLVM for Compile Time


@whitneywhtsang, can you add the “project type” (large/medium) info?

Here is a related discussion. cc @MatthewKhouzam

1 Like

Thanks for including me!
Obligatory XKCD

If there’s anything I can do to help, please include me! :slight_smile:


I want to keep the project type flexible, the student can choose to have a large or medium project and conclude that in the proposal.

I found this project categorized as easy/medium on the website.
so it’s medium but if the student wants to work more deeply, that’s possible too.
Do i get it right?

yes I think you’re right. You’re free to go deeper once you deliver the expected items and there are still some times.

Hi Aniket,

Thank you for your interest in our project. Here is a link to a previous thread initiated by another interested party that has some more information: Good luck with your future endeavors.


Hi @aniketiq,

Does Regarding Instrumentation of Clang/LLVM for Compile Time - #7 by Jamie answer your question?

Hi , I would like to work on this project. I am a compiler engineer , working with Intel Corporation, USA on H1B Visa with a 3 year experience in microsoft native C/C++ compiler. I have a few questions 1. How do I check my eligibility? I checked this link Get Started | Google Summer of Code . But it doesnot mention anything related to Visa.
This is going to be my first experience with GSoC. Bit late in starting to think about my proposal. I see there is a proposal deadline. 2. How will my proposal be different from this project idea and yet fall under this project, what would be the core elements of my proposal ? @Jamie @whitneywhtsang

Hi @sgoynar, regarding visa requirements, I can only suggest that you consult with the appropriate government agencies or a lawyer. It is your responsibility to ensure that you satisfy the legal requirements for working on this project. Regarding the core elements of your proposal, that is for you to consider as part of preparing your proposal. Consider the problem, current state of the code, the ideas presented in this and linked threads, and prepare a proposal of what you feel is appropriate both in terms of advancing the solution and in scope. Thank you for your interest in this project.


Posting in case anyone gets the same question,
Ineligible contributors: from Google Summer of Code

  1. They are an employee (including intern), contractor, officer, or director of:
  2. Google or its affiliates, or
  3. an Organization or any of its affiliates.

hi mentors @Jamie,@whitneywhtsang
this is diksha singh.
i have a great amount of experience in c/c++.
i was suggesting to include the time taken by a particular code section or a function in c/c++.record it and show it in tabular form in form of a comparison and give out an editing option to the as to decerease its time compexity.and an option in CLANG for coders to set the time complexity

1 Like

also can u reply on my gmail account

so that i can get notified with u as soon as posiible

@Jamie @whitneywhtsang
I am a Japanese student at Tokyo University. I want to take part in the project. I have submitted a proposal, so please give me feedback.

1 Like

Hi, I am Rishu Sharma. Currently a first year student at Indian Institute of Information Technology, Sonipat. I have a good knowledge about C++, C, Python and algorithms as I a considerable experience in Competitive Programming using these languages. Till now I haven’t got any chance to work with Clang/LLVM, but looking forward to contribute to the community.

@Kyroyen Welcome to the community! This GSoC project has started already. Feel free to let us know if you have any questions regarding the project.

Hello mentors, @Jamie and @whitneywhtsang , I’m Madhurjya, a computer science undergraduate passionate about innovative technology. I have extensive knowledge of C/C++ and various algorithms, and I enjoy developing new things. I’m particularly interested in this project because I’m currently studying Compiler Design, which has given me a basic theoretical understanding of how compilers work. Working on a real-world project like this would give me hands-on experience and deepen my understanding of the context. I’m excited about the opportunity to work with you and learn from your expertise.

@melsonic Welcome to the community! This is a project from last year. I highly recommend you to apply for [LLVM] Improving compile times, which is a similar topic for this year. Good luck!