1 //===-- ConstantFolding.h - Analyze constant folding possibilities --------===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This family of functions determines the possibility of performing constant
13 //===----------------------------------------------------------------------===//
15 #include "llvm/Constants.h"
16 #include "llvm/Function.h"
21 /// canConstantFoldCallTo - Return true if its even possible to fold a call to
22 /// the specified function.
24 bool canConstantFoldCallTo(Function *F);
26 /// ConstantFoldFP - Given a function that evaluates the constant, return an
27 /// LLVM Constant that represents the evaluated constant
29 ConstantFoldFP(double (*NativeFP)(double), double V, const Type *Ty);
31 /// ConstantFoldCall - Attempt to constant fold a call to the specified function
32 /// with the specified arguments, returning null if unsuccessful.
34 ConstantFoldCall(Function *F, const std::vector<Constant*> &Operands);