IT lexicon › Programming › Dead argument elimination

Dead argument elimination

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

An interprocedural pass that removes parameters a function never reads, and return values no caller ever uses, from both the definition and every call site.

An unused argument costs more than it looks. The caller has to compute the value and put it in a register, perhaps evicting something else to make room. The pass needs to see every call site, so it works on static functions, internally linked symbols and the whole program under link-time optimization. A function whose address has been taken, or that is exported, is left alone.

LLVM ships it as deadargelim. GCC does the equivalent inside IPA-SRA, which can also split a struct passed by pointer into just the fields that are used. Arguments often only become dead after inlining and constant propagation have had a go, so the pass earns its keep late in the pipeline.

← Back to the lexicon