llvm::ConstantFoldSelectInstruction

Attempt to constant fold a select instruction with the specified operands. The constant result is returned if successful; if not, null is returned.

Synopsis

Declared in <llvm/IR/ConstantFold.h>

Constant*
ConstantFoldSelectInstruction(
    Constant* Cond,
    Constant* V1,
    Constant* V2);

Return Value

The folded constant, or null if the select cannot be folded.

Parameters

NameDescription
CondThe select condition.
V1The value selected when Cond is true.
V2The value selected when Cond is false.