LLVM API Documentation
#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>

Go to the source code of this file.
| static Constant* ConstantFoldBinaryFP | ( | double(*)(double, double) | NativeFP, | |
| double | V, | |||
| double | W, | |||
| const Type * | Ty | |||
| ) | [static] |
Definition at line 654 of file ConstantFolding.cpp.
References llvm::lltok::APFloat, llvm::Type::DoubleTy, llvm::Type::FloatTy, and llvm::ConstantFP::get().
Referenced by llvm::ConstantFoldCall().
Definition at line 637 of file ConstantFolding.cpp.
References llvm::lltok::APFloat, llvm::Type::DoubleTy, llvm::Type::FloatTy, and llvm::ConstantFP::get().
Referenced by llvm::ConstantFoldCall().
| static Constant* FoldBitCast | ( | Constant * | C, | |
| const Type * | DestTy, | |||
| const TargetData & | TD | |||
| ) | [static] |
FoldBitCast - Constant fold bitcast, symbolically evaluating it with targetdata. Return 0 if unfoldable.
Definition at line 155 of file ConstantFolding.cpp.
References llvm::dyn_cast(), llvm::User::getNumOperands(), llvm::Type::getPrimitiveSizeInBits(), llvm::Value::getType(), llvm::Type::isFloatingPoint(), llvm::TargetData::isLittleEndian(), llvm::SmallVectorImpl< T >::push_back(), llvm::SmallVectorImpl< T >::size(), and Src.
Referenced by llvm::ConstantFoldCastInstruction(), and llvm::ConstantFoldInstOperands().
| static bool IsConstantOffsetFromGlobal | ( | Constant * | C, | |
| GlobalValue *& | GV, | |||
| int64_t & | Offset, | |||
| const TargetData & | TD | |||
| ) | [static] |
IsConstantOffsetFromGlobal - If this constant is actually a constant offset from a global, return the global and the constant. Because of constantexprs, this function is recursive.
Definition at line 37 of file ConstantFolding.cpp.
References BitCast, CI, llvm::dyn_cast(), llvm::gep_type_begin(), llvm::TargetData::getABITypeSize(), llvm::StructLayout::getElementOffset(), llvm::SequentialType::getElementType(), llvm::ConstantExpr::getOpcode(), llvm::Constant::getOperand(), llvm::ConstantInt::getSExtValue(), llvm::TargetData::getStructLayout(), llvm::Value::getType(), llvm::ConstantInt::getZExtValue(), llvm::User::op_begin(), llvm::User::op_end(), and PtrToInt.
Referenced by SymbolicallyEvaluateBinop().
| 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.