What's the current status of GlobalISel 2026?

Does GlobalISel support all backend ? x86, arm, riscv

Does it provide better performance ?

Does it solve problems of SelectionDAG ?

2 Likes

Most in-tree targets are currently SDISel-based. Of those, GISel support for AArch64 and AMDGPU are the most complete. Other targets are also being incrementally retrofitted (X86, RISCV, WebAssembly), but those are not as far along.

There are some known downstream targets that are 100% GISel from the outset, including a GPU target that I’ve spearheaded at NVIDIA for the last 6 years or so. This is a production-quality backend with stringent compile-time and run-time performance requirements. Others reading this may chime in on their downstream GISel targets.

If your question is leading up to “is GISel ready for prime time”, then the simple answer is yes.

These are involved questions and not specific. But the simple (equally vague) answer is that, yes, GISel solves some of the problems of SDISel. GISel has the potential to improve performance (both compile-time and runtime) relative to SDISel for a particular target. But only AArch64 (AFAIK) has both supported completely enough to make a direct comparison.

For our downstream target, we intentionally chose GISel for the potential benefits and have been very happy with the results in an absolute sense-- but there is no SDISel to compare it to. That said, we compete extremely well against an existing, non-LLVM, proprietary backend that had been developed and tuned for many years along every dimension.

Visit the link below for a similar discussion about this topic 7-8 months ago. It discusses the same issues above and contains multiple viewpoints/experiences.

https://discourse.llvm.org/t/instruction-selection-globalisel-vs-selectiondag-in-2025

My downstream fork, LLVM-Z80, uses GISel exclusively for its code generation pipeline.

My backend development experience is limited, so I can’t directly compare GISel with SDISel, but at least I haven’t encountered any major issues with GlobalISel.

1 Like

This answer seems very different from the answer in Status on enabling GlobalIsel by default on clang (on aarch64)? - #3 by amara which states

since 2022 GlobalISel also fell behind SelectionDAG in terms of code size and performance further. We need to address these issues before we can consider enabling this again.

Sorry for being salty, but based on my experience, I would summarize GlobalISel as “it has huge potential, but you have to realize it yourself”. That is compared to SelectionDAG, where you can just setOperationAction() and everything magically works and optimizes very well.

Just one example.
My target doesn’t support canonical overflow-aware operations like G_UADDO. Instead it has instructions that produce flags in a hardware register (similar to X86’s EFLAGS). I’m supposed to lower G_UADDO to a custom generic instruction, but that means that the lowered instruction will not be optimized the generic code at all.
Contrary, in SelectionDAG, thanks to multi-stage optimization pipeline, the generic node is type-legalized and optimized by the generic code first, and only at the end of the pipeline I convert it to a custom node and do a very few very simple custom optimizations.

Of course I could pretend that G_UADDO is legal on my target and add another pass to legalize it, but that way I will end up reimplementing SelectionDAG.

This was likely referring to AArch64, where this is the case. Given SelectionDAG is still the default at O3, that is still the focus for any optimizations, and any optimizations that are made on the SelectionDAG side likely need to be ported to GlobalISel in order for GlobalISel to maintain parity.

The status of AArch64 GlobalISel doesn’t really say anything about how the two ISel frameworks can compare performance wise assuming full implementations for both.

1 Like