ΒΆllvm::Constant* ConstantFoldInstruction(
llvm::Instruction* I,
const llvm::DataLayout& DL,
const llvm::TargetLibraryInfo* TLI = nullptr)
llvm::Constant* ConstantFoldInstruction(
llvm::Instruction* I,
const llvm::DataLayout& DL,
const llvm::TargetLibraryInfo* TLI = nullptr)
Description
ConstantFoldInstruction - Try to constant fold the specified instruction. If successful, the constant result is returned, if not, null is returned. Note that this fails if not all of the operands are constant. Otherwise, this function can only fail when attempting to fold instructions like loads and stores, which have no constant expression form.
Declared at: llvm/include/llvm/Analysis/ConstantFolding.h:46
Parameters
- llvm::Instruction* I
- const llvm::DataLayout& DL
- const llvm::TargetLibraryInfo* TLI = nullptr