diff options
author | John Criswell <criswell@uiuc.edu> | 2005-10-27 16:00:10 +0000 |
---|---|---|
committer | John Criswell <criswell@uiuc.edu> | 2005-10-27 16:00:10 +0000 |
commit | bd9d37026a5c17d9a51371a6a5446bf4761ee7d6 (patch) | |
tree | 4b3e2fefd6bc2d735f4e96c50164e81fce67bd4a /include/llvm/Analysis | |
parent | a11564335749cd259d8a1391be34c1abbe302c42 (diff) | |
download | llvm-bd9d37026a5c17d9a51371a6a5446bf4761ee7d6.tar.gz llvm-bd9d37026a5c17d9a51371a6a5446bf4761ee7d6.tar.bz2 llvm-bd9d37026a5c17d9a51371a6a5446bf4761ee7d6.tar.xz |
Move some constant folding functions into LLVMAnalysis since they are used
by Analysis and Transformation passes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24038 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis')
-rw-r--r-- | include/llvm/Analysis/ConstantFolding.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/include/llvm/Analysis/ConstantFolding.h b/include/llvm/Analysis/ConstantFolding.h new file mode 100644 index 0000000000..4e996f9d08 --- /dev/null +++ b/include/llvm/Analysis/ConstantFolding.h @@ -0,0 +1,36 @@ +//===-- ConstantFolding.h - Analyze constant folding possibilities --------===// +// +// The LLVM Compiler Infrastructure +// +// This file was developed by the LLVM research group and is distributed under +// the University of Illinois Open Source License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This family of functions determines the possibility of performing constant +// folding. +// +//===----------------------------------------------------------------------===// + +#include "llvm/Constants.h" +#include "llvm/Function.h" +using namespace llvm; + +namespace llvm { + +/// canConstantFoldCallTo - Return true if its even possible to fold a call to +/// the specified function. +extern +bool canConstantFoldCallTo(Function *F); + +/// ConstantFoldFP - Given a function that evaluates the constant, return an +/// LLVM Constant that represents the evaluated constant +extern Constant * +ConstantFoldFP(double (*NativeFP)(double), double V, const Type *Ty); + +/// ConstantFoldCall - Attempt to constant fold a call to the specified function +/// with the specified arguments, returning null if unsuccessful. +extern Constant * +ConstantFoldCall(Function *F, const std::vector<Constant*> &Operands); +} + |