Skip to content

Advanced IR Generation and IT Certification Exams

  • Contact Us
Close Menu

Technical requirements – Optimizing IR

April 4, 2024April 4, 2024| Donna martinTechnical requirements – Optimizing IR| 0 Comment| 03:56

Categories :
  • Adding debug metadata
  • Adding line numbers
  • Catching an exception
  • Exams of IT
  • ITCertification Exams

LLVM uses a series of passes to optimize the IR. A pass operates on a unit of IR, such as a function or a module. The operation can be a transformation, which changes the IR in a defined way, or an analysis, which collects information such as dependencies. This series of passes is called the pass pipeline. The pass manager executes the pass pipeline on the IR, which our compiler produces. Therefore, you need to know what the pass manager does and how to construct a pass pipeline. The semantics of a programming language may require the development of new passes, and we must add these passes to the pipeline.

In this chapter, you will learn about the following:

  • How to leverage the LLVM pass manager to implement passes within LLVM
  • How to implement an instrumentation pass, as an example, within the LLVM project, as well as a separate plugin
  • In using the ppprofiler pass with LLVM tools, you will learn how to use a pass plugin with opt and clang
  • In adding an optimization pipeline to your compiler, you will extend the tinylang compiler with an optimization pipeline based on the new pass manager

By the end of this chapter, you will know how to develop a new pass and how you can add it to a pass pipeline. You will also be able to set up the pass pipeline in your compiler.

Technical requirements

The source code for this chapter is available at https://github.com/PacktPublishing/Learn-LLVM-17/tree/main/Chapter07.

Post navigation

Previous page Adding debug support to tinylang – Advanced IR Generation-3
Next page The LLVM pass manager – Optimizing IR

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Related Post

Raising an exception – Advanced IR Generation

September 27, 2022September 27, 2022 Donna martinRaising an exception – Advanced IR Generation

To generate the IR code to raise an exception, we will add the addThrow() method. [...]

Read MoreRead More

Adding support for multiple inheritance – IR Generation for High-Level Language Constructs-1

December 28, 2021December 28, 2021 Donna martinAdding support for multiple inheritance – IR Generation for High-Level Language Constructs-1

Multiple inheritance adds another challenge. If a class inherits from two or more base classes, [...]

Read MoreRead More

Tracking variables and their values – Advanced IR Generation-2

October 9, 2023October 9, 2023 Donna martinTracking variables and their values – Advanced IR Generation-2

Again, we have to specify a source location for the variable. An instance of llvm::DILocation [...]

Read MoreRead More

Search

Dropdown Categories

Archives

  • August 2024
  • July 2024
  • June 2024
  • May 2024
  • April 2024
  • March 2024
  • February 2024
  • January 2024
  • December 2023
  • October 2023
  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • June 2022
  • May 2022
  • March 2022
  • February 2022
  • December 2021
  • November 2021

Meta

  • Log in

Tag Cloud

Back to Top

Cookie Policy | Terms | Privacy | About Us | © Sherrieland