Pass that hoists and coalesces expensive constants for codegen.

Synopsis

Declared in <llvm/Transforms/Scalar/ConstantHoisting.h>

class ConstantHoistingPass
    : public OptionalPassInfoMixin<ConstantHoistingPass>

Description

Identifies expensive integer constants and simple constant cast expressions, coalesces similar ones to reduce register pressure, and hides hoisted values behind bitcasts so SelectionDAG keeps a single live‐out copy instead of duplicating materialization per basic block.

Base Classes

Name

Description

OptionalPassInfoMixin<ConstantHoistingPass>

A CRTP mix‐in for passes that can be skipped.

Member Functions

Name

Description

cleanup

Clear pass‐local candidate and cast‐clone maps after a run.

run

Run constant hoisting over the function.

runImpl

Run constant hoisting using already‐fetched analyses (legacy PM glue).

Static Member Functions

Name

Description

isRequired

Return false; optional passes may be skipped.

Created with MrDocs