Skip to content
0:00 / 0:00

#ssa#gocompiler#staticsingleassignment

GopherCon 2017: Generating Better Machine Code with SSA - Keith Randall

Gopher Academy

41K subscribers • 5 videos on Hallway

YouTube
  • Recommended by 2 people: 1 on Lobsters and 1 in engineering communities.
  • A classic. People kept recommending it from 2017 to 2021.
  • Presented by Keith Randall

Intermediate. Assumes working knowledge.

13K views9 years ago2 recommendations

Systems programmingProgramming languagesCompilers and interpretersGoPerformance and optimization

Keith Randall explains how the Go compiler's Static Single Assignment backend works and enables new machine-code optimizations.

I will describe the efforts over the past two years to build a better machine-code generator for Go. Based on a SSA (Static Single Assignment) representation, I'll show you how it works and how it enables a host of new optimizations. Some assembly required.

Why it's here

2 people recommend this

What people say. Recommended as a useful and comprehensible explanation of how SSA enables compiler optimizations.

inactive-useron Lobsters • Recommends

Generating Better Machine Code with SSA (2017)

u/oilshellin r/ProgrammingLanguages • Recommends

On “CppCon 2017: Matt Godbolt “What Has My Compiler Done for Me Lately? Unbolting the Compiler's Lid” [video]”

…ly uses multiple representations. I think LLVM was started in the early 2000's, and some important research in SSA might have only been 10 years old at that point (i.e. early 90's). I skimmed a few papers a few months ago but haven't gone back to them. ----- I found this video on the new Go SSA back end to be pretty useful and comprehensible: link to this video He goes over a few optimizations that are trivial with SSA but would require a lot of analysis without the transformation to SSA. As far as I remember finding unused functions and unused variables is now trivial. From my notes: common subexpression elimination, dead store removal, Nil check removal, bounds check removal, etc. It seems…