Fold a constant using the specified DataLayout.

Synopsis

Declared in <llvm/Analysis/ConstantFolding.h>

Constant*
ConstantFoldConstant(
    Constant const* C,
    DataLayout const& DL,
    TargetLibraryInfo const* TLI = nullptr);

Description

This function always returns a non‐null constant: Either the folding result, or the original constant if further folding is not possible.

Return Value

The folded constant, or C if no further folding is possible.

Parameters

Name

Description

C

Constant to fold.

DL

Data layout used for type sizes and pointer widths.

TLI

Optional target library info for libcall folding.

Created with MrDocs