00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef LLVM_ANALYSIS_CONSTANTFOLDING_H
00020 #define LLVM_ANALYSIS_CONSTANTFOLDING_H
00021
00022 namespace llvm {
00023 class Constant;
00024 class ConstantExpr;
00025 class Instruction;
00026 class TargetData;
00027 class Function;
00028 class Type;
00029
00035 Constant *ConstantFoldInstruction(Instruction *I, const TargetData *TD = 0);
00036
00040 Constant *ConstantFoldConstantExpression(const ConstantExpr *CE,
00041 const TargetData *TD = 0);
00042
00049 Constant *ConstantFoldInstOperands(unsigned Opcode, const Type *DestTy,
00050 Constant *const *Ops, unsigned NumOps,
00051 const TargetData *TD = 0);
00052
00057 Constant *ConstantFoldCompareInstOperands(unsigned Predicate,
00058 Constant *LHS, Constant *RHS,
00059 const TargetData *TD = 0);
00060
00064 Constant *ConstantFoldLoadFromConstPtr(Constant *C, const TargetData *TD = 0);
00065
00069 Constant *ConstantFoldLoadThroughGEPConstantExpr(Constant *C, ConstantExpr *CE);
00070
00073 bool canConstantFoldCallTo(const Function *F);
00074
00077 Constant *
00078 ConstantFoldCall(Function *F, Constant *const *Operands, unsigned NumOperands);
00079 }
00080
00081 #endif