LLVM API Documentation

ConstantFolding.cpp File Reference

#include "llvm/Analysis/ConstantFolding.h"
#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Function.h"
#include "llvm/Instructions.h"
#include "llvm/Intrinsics.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Support/GetElementPtrTypeIterator.h"
#include "llvm/Support/MathExtras.h"
#include <cerrno>
#include <cmath>

Include dependency graph for ConstantFolding.cpp:

Go to the source code of this file.

Functions

static bool IsConstantOffsetFromGlobal (Constant *C, GlobalValue *&GV, int64_t &Offset, const TargetData &TD)
static ConstantSymbolicallyEvaluateBinop (unsigned Opc, Constant *Op0, Constant *Op1, const TargetData *TD)
static ConstantSymbolicallyEvaluateGEP (Constant *const *Ops, unsigned NumOps, const Type *ResultTy, const TargetData *TD)
static ConstantFoldBitCast (Constant *C, const Type *DestTy, const TargetData &TD)
Constantllvm::ConstantFoldInstruction (Instruction *I, const TargetData *TD=0)
Constantllvm::ConstantFoldConstantExpression (ConstantExpr *CE, const TargetData *TD)
Constantllvm::ConstantFoldInstOperands (unsigned Opcode, const Type *DestTy, Constant *const *Ops, unsigned NumOps, const TargetData *TD=0)
Constantllvm::ConstantFoldCompareInstOperands (unsigned Predicate, Constant *const *Ops, unsigned NumOps, const TargetData *TD=0)
Constantllvm::ConstantFoldLoadThroughGEPConstantExpr (Constant *C, ConstantExpr *CE)
bool llvm::canConstantFoldCallTo (const Function *F)
static ConstantConstantFoldFP (double(*NativeFP)(double), double V, const Type *Ty)
static ConstantConstantFoldBinaryFP (double(*NativeFP)(double, double), double V, double W, const Type *Ty)
Constantllvm::ConstantFoldCall (Function *F, Constant *const *Operands, unsigned NumOperands)


Function Documentation

static Constant* ConstantFoldBinaryFP ( double(*)(double, double)  NativeFP,
double  V,
double  W,
const Type Ty 
) [static]

static Constant* ConstantFoldFP ( double(*)(double)  NativeFP,
double  V,
const Type Ty 
) [static]

static Constant* FoldBitCast ( Constant C,
const Type DestTy,
const TargetData TD 
) [static]

static bool IsConstantOffsetFromGlobal ( Constant C,
GlobalValue *&  GV,
int64_t &  Offset,
const TargetData TD 
) [static]

static Constant* SymbolicallyEvaluateBinop ( unsigned  Opc,
Constant Op0,
Constant Op1,
const TargetData TD 
) [static]

SymbolicallyEvaluateBinop - One of Op0/Op1 is a constant expression. Attempt to symbolically evaluate the result of a binary operator merging these together. If target data info is available, it is provided as TD, otherwise TD is null.

Definition at line 93 of file ConstantFolding.cpp.

References llvm::Value::getType(), and IsConstantOffsetFromGlobal().

Referenced by llvm::ConstantFoldInstOperands().

static Constant* SymbolicallyEvaluateGEP ( Constant *const *  Ops,
unsigned  NumOps,
const Type ResultTy,
const TargetData TD 
) [static]

SymbolicallyEvaluateGEP - If we can symbolically evaluate the specified GEP constant expression, do so.

Definition at line 121 of file ConstantFolding.cpp.

References Base, llvm::CallingConv::C, llvm::TargetData::getIndexedOffset(), llvm::TargetData::getIntPtrType(), llvm::Value::getType(), llvm::Constant::isNullValue(), and Offset.

Referenced by llvm::ConstantFoldInstOperands().




This web site is hosted by the Computer Science Department at the University of Illinois at Urbana-Champaign.