Move some constant folding functions into LLVMAnalysis since they are used
[oota-llvm.git] / include / llvm / Analysis / ConstantFolding.h
1 //===-- ConstantFolding.h - Analyze constant folding possibilities --------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
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.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This family of functions determines the possibility of performing constant
11 // folding.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #include "llvm/Constants.h"
16 #include "llvm/Function.h"
17 using namespace llvm;
18
19 namespace llvm {
20
21 /// canConstantFoldCallTo - Return true if its even possible to fold a call to
22 /// the specified function.
23 extern
24 bool canConstantFoldCallTo(Function *F);
25
26 /// ConstantFoldFP - Given a function that evaluates the constant, return an
27 ///                  LLVM Constant that represents the evaluated constant
28 extern Constant *
29 ConstantFoldFP(double (*NativeFP)(double), double V, const Type *Ty);
30
31 /// ConstantFoldCall - Attempt to constant fold a call to the specified function
32 /// with the specified arguments, returning null if unsuccessful.
33 extern Constant *
34 ConstantFoldCall(Function *F, const std::vector<Constant*> &Operands);
35 }
36