IT lexicon › Programming › WHOPR

WHOPR

Programming På svenska → Updated: 2026-11-07

GCC's way of making link-time optimization parallel: analyse the whole program at once, but optimize and generate code in pieces.

The name stands for WHOle Program optimizeR, and the work is split into three phases. In LGEN each compilation writes its GIMPLE and a summary into the object file. In WPA a single process reads only the summaries, makes the interprocedural decisions about inlining and cloning, and carves the program into partitions. In LTRANS the partitions are optimized separately in parallel processes and turned into machine code. The expensive global step never has to look at every function body.

WHOPR arrived as -fwhopr in GCC 4.5 in 2010, and by 4.6 it was simply how -flto worked; the separate flag disappeared. -flto=auto sets the number of parallel jobs, and -flto-partition chooses how the program is sliced. It was this model that eventually made it reasonable to build Firefox and entire Linux distributions with LTO under GCC, a few years before LLVM arrived at something similar with ThinLTO.

← Back to the lexicon