RSSAmplifier

Blog

nikic's blog

NikiC's blog about PHP

npopov.comRSS feed ↗9 posts

Latest posts

This year in LLVM (2025)

It’s 2026, so it’s time for my yearly summary blog post. I’m a bit late, but at least it’s still January! As usual, this summary is about my own work, and only covers the more significant / higher-level items. Previous years: 2024 , 2023 , 2022 ptradd I have been making slow progress on the ptradd migration over the last three years. The goal of this change is to move away from the type-based…

LLVM: The bad parts

A few years ago, I wrote a blog post on design issues in LLVM IR . Since then, one of these issues has been fixed fully (opaque pointers migration), one has been mostly fixed (constant expression removal), and one is well on the way towards being fixed (ptradd migration). This time I’m going to be more ambitious and not stop at three issues. Of course, not all of these issues are of equal…

This year in LLVM (2024)

Another year has passed, so it’s once again time for my yearly summary blog post. As usual, this summary is mostly about my own work, and only covers the more significant / higher level items. Previous years: 2023 , 2022 ptradd I started working on the ptradd migration last year, but the first significant steps towards it only landed this year. The goal is to move away from the…

Making memcpy(NULL, NULL, 0) well-defined

This year in LLVM (2023)

This is my second year working on LLVM at Red Hat. Similar to last year’s blog post , I want to summarize some of the things I’ve worked on this year. Opaque pointers The opaque pointer migration is the main task I worked on last year, and it carried substantially over into this year as well. The goal of this change was to replace typed pointers like i32* , void(i32)** or %struct.T* with a single…

How single-iteration InstCombine improves LLVM compile time

How to reduce LLVM crashes

Unlike miscompilations, reducing compiler crashes to a minimal test case is a straightforward process, which always follows the same general approach, and is supported by high-quality reduction tooling. However, I don’t think the entire process (and some of the edge cases) is documented anywhere, so I am trying to remedy that. Prerequisites To reduce LLVM crashes, it is strongly recommended to use…

LLVM: Scalar evolution

Scalar evolution (SE or SCEV) models how values change inside loops. It can answer questions like “how many iterations does this loop perform?” and “What value does this variable have on the Nth iteration?” As such, it is the main building block for loop optimizations. Scalar evolution models values using non-recursive expressions, which are called SCEVs. Yes, we use the same term for the whole…

LLVM: Canonicalization and target-independence

Conceptually, the backend of an optimizing compiler is supposed to be the part that performs CPU architecture specific optimizations, while the middle-end is target-independent. In reality, the middle-end does need to take certain properties of the target into account. However, these need to be carefully managed to maintain the overall architecture of the compiler. In this article, I want to…