Dead-code elimination

Removing such code has several benefits: it shrinks program size, an important consideration in some contexts, it reduces resource usage such as the number of bytes to be transferred[1] and it allows the running program to avoid executing irrelevant operations, which reduces its running time.Because the expression 0 will always evaluate to false, the code inside the if statement can never be executed, and dead-code elimination would remove it entirely from the optimized program.Such conditions may be imposed by different runtime environments (for example different versions of an operating system, or different sets and combinations of drivers or services loaded in a particular target environment), which may require different sets of special cases in the code, but at the same time become conditionally dead code for the other cases.[6][7] Also, the software (for example, a driver or resident service) may be configurable to include or exclude certain features depending on user preferences, rendering unused code portions useless in a particular scenario.[6][7] While modular software may be developed to dynamically load libraries on demand only, in most cases, it is not possible to load only the relevant routines from a particular library, and even if this would be supported, a routine may still include code sections which can be considered dead code in a given scenario, but could not be ruled out at compile time, already.
compiler theorycompiler optimizationdead codeprogramoperationsrunning timeunreachable codedead variablescontrol flowconstant foldingpreprocessordebuggingstrength reductiondata-flow analysisstatic single-assignment formcompile timeruntime environmentsruntimedynamic loadinglate linkingcompiled ahead-of-timeassembly languagejust-in-time compilationdynamic software updatinghot patchingRedundant codeSimplification (symbolic computation)Partial-redundancy eliminationConjunction eliminationDynamic coupling (computing)Self-relocationSoftware cruftTree shakingPost-pass optimizationProfile-guided optimizationSuperoptimizerFunction multi-versioningCocke, JohnKennedy, KenJones, Neil D.Muchnick, Steven StanleyPrentice-HallFerrante, JeanneACM TOPLASCooper, Keith D.Morgan KaufmannDynamic Dead Code EliminationUnicodekeyboard layoutscode pagescountry codesmacro assemblercode morphingmeta dataexecutable filebinary coderelaxingrelocating loaderdynamic dead-code eliminationrelocationload-timeself-modifying coderun-timecanonical formNewsgroupdynamischen Dead-Code-Eliminationassembleddynamic dead-code-eliminationUniversity of CincinnatiWayback MachineLazy evaluationfunctional languagesUniversity of Wisconsin-MadisonASPLOSIBM Corp.Universite des Sciences et Technologies de LilleGupta, RajivAho, Alfred VainoSethi, RaviUllman, Jeffrey DavidAddison Wesley Publishing CompanyMorgan Kaufmann PublishersGrune, DickBal, Henri ElleJohn Wiley & Sons, Inc.Academic PressElsevierCiteSeerXCompiler optimizationsPeephole optimizationLocal value numberingLoop nest optimizationLoop splittingLoop unrollingLoop unswitchingSoftware pipeliningData-flowanalysisAvailable expressionCommon subexpression eliminationDead storeInduction variable recognition and eliminationLive-variable analysisUpwards exposed usesUse-define chainReaching definitionsGlobal value numberingSparse conditional constant propagationCode generationInstruction schedulingInstruction selectionRegister allocationRematerializationDeforestationTail-call eliminationInterprocedural optimizationBounds-checking eliminationCompile-time function executionExpression templatesInline expansionJump threadingPartial evaluationAlias analysisArray-access analysisControl-flow analysisDependence analysisEscape analysisPointer analysisShape analysisValue range analysis