LLVM API Documentation
#include <Constants.h>
Public Member Functions | |
| DECLARE_TRANSPARENT_OPERAND_ACCESSORS (Constant) | |
| Transparently provide more efficient getOperand methods. | |
| bool | isCast () const |
| Return true if this is a convert constant expression. | |
| bool | isCompare () const |
| Return true if this is a compare constant expression. | |
| bool | hasIndices () const |
| Return true if this is an insertvalue or extractvalue expression, and the getIndices() method may be used. | |
| virtual bool | isNullValue () const |
| unsigned | getOpcode () const |
| getOpcode - Return the opcode at the root of this constant expression | |
| unsigned | getPredicate () const |
| const SmallVector< unsigned, 4 > & | getIndices () const |
| const char * | getOpcodeName () const |
| getOpcodeName - Return a string representation for an opcode. | |
| Constant * | getWithOperandReplaced (unsigned OpNo, Constant *Op) const |
| Constant * | getWithOperands (const std::vector< Constant * > &Ops) const |
| Constant * | getWithOperands (Constant *const *Ops, unsigned NumOps) const |
| virtual void | destroyConstant () |
| virtual void | replaceUsesOfWithOnConstant (Value *From, Value *To, Use *U) |
Static Public Member Functions | |
| static Constant * | getTrunc (Constant *C, const Type *Ty) |
| static Constant * | getSExt (Constant *C, const Type *Ty) |
| static Constant * | getZExt (Constant *C, const Type *Ty) |
| static Constant * | getFPTrunc (Constant *C, const Type *Ty) |
| static Constant * | getFPExtend (Constant *C, const Type *Ty) |
| static Constant * | getUIToFP (Constant *C, const Type *Ty) |
| static Constant * | getSIToFP (Constant *C, const Type *Ty) |
| static Constant * | getFPToUI (Constant *C, const Type *Ty) |
| static Constant * | getFPToSI (Constant *C, const Type *Ty) |
| static Constant * | getPtrToInt (Constant *C, const Type *Ty) |
| static Constant * | getIntToPtr (Constant *C, const Type *Ty) |
| static Constant * | getBitCast (Constant *C, const Type *Ty) |
| static Constant * | getCast (unsigned ops, Constant *C, const Type *Ty) |
| static Constant * | getZExtOrBitCast (Constant *C, const Type *Ty) |
| static Constant * | getSExtOrBitCast (Constant *C, const Type *Ty) |
| static Constant * | getTruncOrBitCast (Constant *C, const Type *Ty) |
| static Constant * | getPointerCast (Constant *C, const Type *Ty) |
| Create a BitCast or a PtrToInt cast constant expression. | |
| static Constant * | getIntegerCast (Constant *C, const Type *Ty, bool isSigned) |
| Create a ZExt, Bitcast or Trunc for integer -> integer casts. | |
| static Constant * | getFPCast (Constant *C, const Type *Ty) |
| Create a FPExt, Bitcast or FPTrunc for fp -> fp casts. | |
| static Constant * | getSelect (Constant *C, Constant *V1, Constant *V2) |
| static Constant * | getSizeOf (const Type *Ty) |
| static Constant * | get (unsigned Opcode, Constant *C1, Constant *C2) |
| static Constant * | getCompare (unsigned short pred, Constant *C1, Constant *C2) |
| Return an ICmp, FCmp, VICmp, or VFCmp comparison operator constant expression. | |
| static Constant * | getNeg (Constant *C) |
| static Constant * | getNot (Constant *C) |
| static Constant * | getAdd (Constant *C1, Constant *C2) |
| static Constant * | getSub (Constant *C1, Constant *C2) |
| static Constant * | getMul (Constant *C1, Constant *C2) |
| static Constant * | getUDiv (Constant *C1, Constant *C2) |
| static Constant * | getSDiv (Constant *C1, Constant *C2) |
| static Constant * | getFDiv (Constant *C1, Constant *C2) |
| static Constant * | getURem (Constant *C1, Constant *C2) |
| static Constant * | getSRem (Constant *C1, Constant *C2) |
| static Constant * | getFRem (Constant *C1, Constant *C2) |
| static Constant * | getAnd (Constant *C1, Constant *C2) |
| static Constant * | getOr (Constant *C1, Constant *C2) |
| static Constant * | getXor (Constant *C1, Constant *C2) |
| static Constant * | getICmp (unsigned short pred, Constant *LHS, Constant *RHS) |
| static Constant * | getFCmp (unsigned short pred, Constant *LHS, Constant *RHS) |
| static Constant * | getVICmp (unsigned short pred, Constant *LHS, Constant *RHS) |
| static Constant * | getVFCmp (unsigned short pred, Constant *LHS, Constant *RHS) |
| static Constant * | getShl (Constant *C1, Constant *C2) |
| static Constant * | getLShr (Constant *C1, Constant *C2) |
| static Constant * | getAShr (Constant *C1, Constant *C2) |
| static Constant * | getGetElementPtr (Constant *C, Constant *const *IdxList, unsigned NumIdx) |
| static Constant * | getGetElementPtr (Constant *C, Value *const *IdxList, unsigned NumIdx) |
| static Constant * | getExtractElement (Constant *Vec, Constant *Idx) |
| static Constant * | getInsertElement (Constant *Vec, Constant *Elt, Constant *Idx) |
| static Constant * | getShuffleVector (Constant *V1, Constant *V2, Constant *Mask) |
| static Constant * | getExtractValue (Constant *Agg, const unsigned *IdxList, unsigned NumIdx) |
| static Constant * | getInsertValue (Constant *Agg, Constant *Val, const unsigned *IdxList, unsigned NumIdx) |
| static Constant * | getZeroValueForNegationExpr (const Type *Ty) |
| static bool | classof (const ConstantExpr *) |
| Methods for support type inquiry through isa, cast, and dyn_cast:. | |
| static bool | classof (const Value *V) |
Protected Member Functions | |
| ConstantExpr (const Type *ty, unsigned Opcode, Use *Ops, unsigned NumOps) | |
Static Protected Member Functions | |
| static Constant * | getTy (const Type *Ty, unsigned Opcode, Constant *C1, Constant *C2) |
| static Constant * | getCompareTy (unsigned short pred, Constant *C1, Constant *C2) |
| static Constant * | getSelectTy (const Type *Ty, Constant *C1, Constant *C2, Constant *C3) |
| static Constant * | getGetElementPtrTy (const Type *Ty, Constant *C, Value *const *Idxs, unsigned NumIdxs) |
| static Constant * | getExtractElementTy (const Type *Ty, Constant *Val, Constant *Idx) |
| static Constant * | getInsertElementTy (const Type *Ty, Constant *Val, Constant *Elt, Constant *Idx) |
| static Constant * | getShuffleVectorTy (const Type *Ty, Constant *V1, Constant *V2, Constant *Mask) |
| static Constant * | getExtractValueTy (const Type *Ty, Constant *Agg, const unsigned *Idxs, unsigned NumIdxs) |
| static Constant * | getInsertValueTy (const Type *Ty, Constant *Agg, Constant *Val, const unsigned *Idxs, unsigned NumIdxs) |
Friends | |
| struct | ConstantCreator< ConstantExpr, Type, std::pair< unsigned, std::vector< Constant * > > > |
| struct | ConvertConstantType< ConstantExpr, Type > |
This class uses the standard Instruction opcodes to define the various constant expressions. The Opcode field for the ConstantExpr class is maintained in the Value::SubclassData field.
Definition at line 554 of file Constants.h.
| Constant * ConstantExpr::getTy | ( | const Type * | Ty, | |
| unsigned | Opcode, | |||
| Constant * | C1, | |||
| Constant * | C2 | |||
| ) | [static, protected] |
Definition at line 2007 of file Constants.cpp.
References llvm::ConstantFoldBinaryInstruction(), llvm::Value::getType(), and llvm::Type::Int1Ty.
Referenced by llvm::ConvertConstantType< ConstantExpr, Type >::convert(), and get().
| Constant * ConstantExpr::getCompareTy | ( | unsigned short | pred, | |
| Constant * | C1, | |||
| Constant * | C2 | |||
| ) | [static, protected] |
Definition at line 2025 of file Constants.cpp.
References llvm::CmpInst::FCMP_FALSE, llvm::CmpInst::FCMP_OEQ, llvm::CmpInst::FCMP_OGE, llvm::CmpInst::FCMP_OGT, llvm::CmpInst::FCMP_OLE, llvm::CmpInst::FCMP_OLT, llvm::CmpInst::FCMP_ONE, llvm::CmpInst::FCMP_ORD, llvm::CmpInst::FCMP_TRUE, llvm::CmpInst::FCMP_UEQ, llvm::CmpInst::FCMP_UGE, llvm::CmpInst::FCMP_UGT, llvm::CmpInst::FCMP_ULE, llvm::CmpInst::FCMP_ULT, llvm::CmpInst::FCMP_UNE, llvm::CmpInst::FCMP_UNO, getFCmp(), getICmp(), llvm::Value::getType(), llvm::Type::getTypeID(), getVFCmp(), getVICmp(), llvm::CmpInst::ICMP_EQ, llvm::CmpInst::ICMP_NE, llvm::CmpInst::ICMP_SGE, llvm::CmpInst::ICMP_SGT, llvm::CmpInst::ICMP_SLE, llvm::CmpInst::ICMP_SLT, llvm::CmpInst::ICMP_UGE, llvm::CmpInst::ICMP_UGT, llvm::CmpInst::ICMP_ULE, llvm::CmpInst::ICMP_ULT, and llvm::Type::VectorTyID.
Referenced by getCompare().
| Constant * ConstantExpr::getSelectTy | ( | const Type * | Ty, | |
| Constant * | C1, | |||
| Constant * | C2, | |||
| Constant * | C3 | |||
| ) | [static, protected] |
Definition at line 2112 of file Constants.cpp.
References llvm::SelectInst::areInvalidOperands(), llvm::ConstantFoldSelectInstruction(), and llvm::Value::getType().
Referenced by llvm::ConvertConstantType< ConstantExpr, Type >::convert(), and getSelect().
| Constant * ConstantExpr::getGetElementPtrTy | ( | const Type * | Ty, | |
| Constant * | C, | |||
| Value *const * | Idxs, | |||
| unsigned | NumIdxs | |||
| ) | [static, protected] |
Definition at line 2127 of file Constants.cpp.
References llvm::ConstantFoldGetElementPtr(), and llvm::Value::getType().
Referenced by llvm::ConvertConstantType< ConstantExpr, Type >::convert(), and getGetElementPtr().
| Constant * ConstantExpr::getExtractElementTy | ( | const Type * | Ty, | |
| Constant * | Val, | |||
| Constant * | Idx | |||
| ) | [static, protected] |
Definition at line 2293 of file Constants.cpp.
References llvm::ConstantFoldExtractElementInstruction().
Referenced by getExtractElement().
| Constant * ConstantExpr::getInsertElementTy | ( | const Type * | Ty, | |
| Constant * | Val, | |||
| Constant * | Elt, | |||
| Constant * | Idx | |||
| ) | [static, protected] |
Definition at line 2313 of file Constants.cpp.
References llvm::ConstantFoldInsertElementInstruction(), and InsertElement.
Referenced by getInsertElement().
| Constant * ConstantExpr::getShuffleVectorTy | ( | const Type * | Ty, | |
| Constant * | V1, | |||
| Constant * | V2, | |||
| Constant * | Mask | |||
| ) | [static, protected] |
Definition at line 2336 of file Constants.cpp.
References llvm::ConstantFoldShuffleVectorInstruction().
Referenced by getShuffleVector().
| Constant * ConstantExpr::getExtractValueTy | ( | const Type * | Ty, | |
| Constant * | Agg, | |||
| const unsigned * | Idxs, | |||
| unsigned | NumIdxs | |||
| ) | [static, protected] |
Definition at line 2384 of file Constants.cpp.
References llvm::ConstantFoldExtractValueInstruction(), llvm::Value::getType(), and llvm::Type::isFirstClassType().
Referenced by getExtractValue().
| Constant * ConstantExpr::getInsertValueTy | ( | const Type * | Ty, | |
| Constant * | Agg, | |||
| Constant * | Val, | |||
| const unsigned * | Idxs, | |||
| unsigned | NumIdxs | |||
| ) | [static, protected] |
Definition at line 2355 of file Constants.cpp.
References llvm::ConstantFoldInsertValueInstruction(), llvm::Value::getType(), and llvm::Type::isFirstClassType().
Referenced by getInsertValue().
Cast constant expr
Definition at line 1884 of file Constants.cpp.
References getFoldedCast(), llvm::Type::getPrimitiveSizeInBits(), llvm::Value::getType(), and llvm::Type::isInteger().
Referenced by getCast(), and llvm::ScalarEvolution::getTruncateExpr().
Definition at line 1893 of file Constants.cpp.
References getFoldedCast(), llvm::Type::getPrimitiveSizeInBits(), llvm::Value::getType(), llvm::Type::isInteger(), and llvm::Attribute::SExt.
Referenced by llvm::ConstantFoldGetElementPtr(), getCast(), llvm::ScalarEvolution::getSignExtendExpr(), IdxCompare(), and IndexOperandsEqual().
Definition at line 1902 of file Constants.cpp.
References getFoldedCast(), llvm::Type::getPrimitiveSizeInBits(), llvm::Value::getType(), llvm::Type::isInteger(), and ZExt.
Referenced by llvm::ConstantFoldGetElementPtr(), getCast(), and llvm::ScalarEvolution::getZeroExtendExpr().
Definition at line 1911 of file Constants.cpp.
References FPTrunc, getFoldedCast(), llvm::Type::getPrimitiveSizeInBits(), llvm::Value::getType(), and llvm::Type::isFloatingPoint().
Referenced by getCast().
Definition at line 1918 of file Constants.cpp.
References getFoldedCast(), llvm::Type::getPrimitiveSizeInBits(), llvm::Value::getType(), and llvm::Type::isFloatingPoint().
Referenced by getCast().
Definition at line 1925 of file Constants.cpp.
References getFoldedCast(), llvm::Value::getType(), llvm::Type::getTypeID(), llvm::Type::isFPOrFPVector(), llvm::Type::isIntOrIntVector(), UIToFP, and llvm::Type::VectorTyID.
Referenced by getCast().
Definition at line 1936 of file Constants.cpp.
References getFoldedCast(), llvm::Value::getType(), llvm::Type::getTypeID(), llvm::Type::isFPOrFPVector(), llvm::Type::isIntOrIntVector(), and llvm::Type::VectorTyID.
Referenced by getCast().
Definition at line 1947 of file Constants.cpp.
References FPToUI, getFoldedCast(), llvm::Value::getType(), llvm::Type::getTypeID(), llvm::Type::isFPOrFPVector(), llvm::Type::isIntOrIntVector(), and llvm::Type::VectorTyID.
Referenced by getCast().
Definition at line 1958 of file Constants.cpp.
References getFoldedCast(), llvm::Value::getType(), llvm::Type::getTypeID(), llvm::Type::isFPOrFPVector(), llvm::Type::isIntOrIntVector(), and llvm::Type::VectorTyID.
Referenced by getCast().
Definition at line 1969 of file Constants.cpp.
References getFoldedCast(), llvm::Value::getType(), llvm::Type::isInteger(), and PtrToInt.
Referenced by getCast().
Definition at line 1975 of file Constants.cpp.
References getFoldedCast(), llvm::Value::getType(), and llvm::Type::isInteger().
Referenced by llvm::ConstantFoldGetElementPtr(), getCast(), and llvm::JIT::runFunction().
Definition at line 1981 of file Constants.cpp.
References BitCast, getFoldedCast(), llvm::Type::getPrimitiveSizeInBits(), and llvm::Value::getType().
Referenced by llvm::ConstantFoldInstOperands(), llvm::DIFactory::CreateGlobalVariable(), getCast(), llvm::Module::getOrInsertFunction(), llvm::Module::getOrInsertGlobal(), OptimizeGlobalAddressOfMalloc(), and OptimizeOnceStoredGlobal().
| llvm::ConstantExpr::DECLARE_TRANSPARENT_OPERAND_ACCESSORS | ( | Constant | ) |
Transparently provide more efficient getOperand methods.
| ops | The opcode for the conversion |
| C | The constant to be converted |
| Ty | The type to which the constant is converted |
Definition at line 1807 of file Constants.cpp.
References BitCast, FPToUI, FPTrunc, getBitCast(), getFPExtend(), getFPToSI(), getFPToUI(), getFPTrunc(), getIntToPtr(), getPtrToInt(), getSExt(), getSIToFP(), getTrunc(), getUIToFP(), getZExt(), llvm::Instruction::isCast(), llvm::Type::isFirstClassType(), PtrToInt, llvm::Attribute::SExt, UIToFP, and ZExt.
Referenced by llvm::ConstantFoldCastInstruction(), llvm::ConstantFoldInstOperands(), llvm::ConvertConstantType< ConstantExpr, Type >::convert(), llvm::TargetFolder::CreateCast(), llvm::ConstantFolder::CreateCast(), getFPCast(), getIntegerCast(), getPointerCast(), getSExtOrBitCast(), getSizeOf(), getTruncOrBitCast(), getWithOperandReplaced(), getWithOperands(), getZExtOrBitCast(), llvm::SCEVExpander::InsertCastOfTo(), OptimizeAwayTrappingUsesOfValue(), and replaceUsesOfWithOnConstant().
| C | The constant to zext or bitcast |
| Ty | The type to zext or bitcast C to |
Definition at line 1833 of file Constants.cpp.
References BitCast, getCast(), llvm::Type::getPrimitiveSizeInBits(), llvm::Value::getType(), and ZExt.
| C | The constant to sext or bitcast |
| Ty | The type to sext or bitcast C to |
Definition at line 1839 of file Constants.cpp.
References BitCast, getCast(), llvm::Type::getPrimitiveSizeInBits(), llvm::Value::getType(), and llvm::Attribute::SExt.
Referenced by llvm::ConstantFoldGetElementPtr().
| C | The constant to trunc or bitcast |
| Ty | The type to trunc or bitcast C to |
Definition at line 1845 of file Constants.cpp.
References BitCast, getCast(), llvm::Type::getPrimitiveSizeInBits(), and llvm::Value::getType().
Referenced by llvm::TargetFolder::CreateTruncOrBitCast(), and llvm::ConstantFolder::CreateTruncOrBitCast().
Create a BitCast or a PtrToInt cast constant expression.
| C | The pointer value to be casted (operand 0) |
| Ty | The type to which cast should be made |
Definition at line 1851 of file Constants.cpp.
References BitCast, getCast(), llvm::Value::getType(), llvm::Type::isInteger(), and PtrToInt.
Referenced by llvm::ConstantFoldCastInstruction().
Create a ZExt, Bitcast or Trunc for integer -> integer casts.
| C | The integer constant to be casted |
| Ty | The integer type to cast to |
| isSigned | Whether C should be treated as signed or not |
Definition at line 1860 of file Constants.cpp.
References BitCast, getCast(), llvm::Type::getPrimitiveSizeInBits(), llvm::Value::getType(), llvm::Type::isInteger(), opcode, llvm::Attribute::SExt, and ZExt.
Referenced by llvm::ConstantFoldCompareInstOperands(), llvm::ConstantFoldInstOperands(), llvm::TargetFolder::CreateIntCast(), llvm::ConstantFolder::CreateIntCast(), and llvm::AsmPrinter::EmitConstantValueOnly().
Create a FPExt, Bitcast or FPTrunc for fp -> fp casts.
| C | The integer constant to be casted |
| Ty | The integer type to cast to |
Definition at line 1872 of file Constants.cpp.
References FPTrunc, getCast(), llvm::Type::getPrimitiveSizeInBits(), llvm::Value::getType(), llvm::Type::isFloatingPoint(), and opcode.
| bool ConstantExpr::isCast | ( | ) | const |
Return true if this is a convert constant expression.
Definition at line 729 of file Constants.cpp.
References getOpcode(), and llvm::Instruction::isCast().
Referenced by FindStaticTors(), foldConstantCastPair(), and replaceUsesOfWithOnConstant().
| bool ConstantExpr::isCompare | ( | ) | const |
Return true if this is a compare constant expression.
Definition at line 733 of file Constants.cpp.
References FCmp, getOpcode(), and VICmp.
Referenced by llvm::ConstantFoldConstantExpression(), getValType(), and replaceUsesOfWithOnConstant().
| bool ConstantExpr::hasIndices | ( | ) | const |
Return true if this is an insertvalue or extractvalue expression, and the getIndices() method may be used.
Definition at line 738 of file Constants.cpp.
References ExtractValue, and getOpcode().
Referenced by getValType().
| static Constant* llvm::ConstantExpr::getSelect | ( | Constant * | C, | |
| Constant * | V1, | |||
| Constant * | V2 | |||
| ) | [inline, static] |
Select constant expr
Definition at line 669 of file Constants.h.
References getSelectTy(), and llvm::Value::getType().
Referenced by llvm::ConstantFoldInstOperands(), llvm::TargetFolder::CreateSelect(), llvm::ConstantFolder::CreateSelect(), getWithOperandReplaced(), getWithOperands(), and replaceUsesOfWithOnConstant().
getSizeOf constant expr - computes the size of a type in a target independent way (Note: the return type is an i64).
Definition at line 1999 of file Constants.cpp.
References llvm::ConstantInt::get(), getCast(), getGetElementPtr(), llvm::Constant::getNullValue(), llvm::PointerType::getUnqual(), llvm::Type::Int32Ty, llvm::Type::Int64Ty, and PtrToInt.
Referenced by llvm::InlineFunction().
ConstantExpr::get - Return a binary or shift operator constant expression, folding if possible.
Definition at line 2047 of file Constants.cpp.
References Add(), And(), getTy(), llvm::Value::getType(), llvm::Type::isFloatingPoint(), llvm::Type::isInteger(), LShr, llvm::APIntOps::Or(), and llvm::APIntOps::Xor().
Referenced by llvm::ConstantFoldGetElementPtr(), llvm::ConstantFoldInstOperands(), llvm::TargetFolder::CreateBinOp(), llvm::ConstantFolder::CreateBinOp(), getWithOperandReplaced(), getWithOperands(), llvm::SCEVExpander::InsertBinop(), and replaceUsesOfWithOnConstant().
Return an ICmp, FCmp, VICmp, or VFCmp comparison operator constant expression.
Definition at line 2106 of file Constants.cpp.
References getCompareTy(), and llvm::Value::getType().
Referenced by llvm::ConstantFoldCompareInstOperands(), llvm::TargetFolder::CreateFCmp(), llvm::ConstantFolder::CreateFCmp(), llvm::TargetFolder::CreateICmp(), llvm::ConstantFolder::CreateICmp(), llvm::TargetFolder::CreateVFCmp(), llvm::ConstantFolder::CreateVFCmp(), llvm::TargetFolder::CreateVICmp(), llvm::ConstantFolder::CreateVICmp(), and getWithOperands().
ConstantExpr::get* - Return some common constants without having to specify the full Instruction::OPCODE identifier.
ConstantExpr::get* - Return some common constants without having to specify the full Instruction::OPCODE identifier.
Definition at line 754 of file Constants.cpp.
References llvm::Value::getType(), and getZeroValueForNegationExpr().
Referenced by llvm::TargetFolder::CreateNeg(), llvm::ConstantFolder::CreateNeg(), llvm::ScalarEvolution::getNegativeSCEV(), and llvm::PatternMatch::neg_match< LHS_t >::match().
Definition at line 759 of file Constants.cpp.
References llvm::Constant::getAllOnesValue(), llvm::Value::getType(), and llvm::APIntOps::Xor().
Referenced by llvm::TargetFolder::CreateNot(), llvm::ConstantFolder::CreateNot(), llvm::ScalarEvolution::getNotSCEV(), and llvm::PatternMatch::not_match< LHS_t >::match().
Definition at line 766 of file Constants.cpp.
References Add().
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::ConstantFoldGetElementPtr(), llvm::TargetFolder::CreateAdd(), and llvm::ConstantFolder::CreateAdd().
Definition at line 769 of file Constants.cpp.
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::TargetFolder::CreateSub(), and llvm::ConstantFolder::CreateSub().
Definition at line 772 of file Constants.cpp.
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::TargetFolder::CreateMul(), and llvm::ConstantFolder::CreateMul().
Definition at line 775 of file Constants.cpp.
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::TargetFolder::CreateUDiv(), llvm::ConstantFolder::CreateUDiv(), and llvm::ScalarEvolution::getUDivExpr().
Definition at line 778 of file Constants.cpp.
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::TargetFolder::CreateSDiv(), and llvm::ConstantFolder::CreateSDiv().
Definition at line 781 of file Constants.cpp.
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::TargetFolder::CreateFDiv(), and llvm::ConstantFolder::CreateFDiv().
Definition at line 784 of file Constants.cpp.
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::TargetFolder::CreateURem(), and llvm::ConstantFolder::CreateURem().
Definition at line 787 of file Constants.cpp.
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::TargetFolder::CreateSRem(), and llvm::ConstantFolder::CreateSRem().
Definition at line 790 of file Constants.cpp.
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::TargetFolder::CreateFRem(), and llvm::ConstantFolder::CreateFRem().
Definition at line 793 of file Constants.cpp.
References And().
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::ConstantFoldInstOperands(), llvm::TargetFolder::CreateAnd(), and llvm::ConstantFolder::CreateAnd().
Definition at line 796 of file Constants.cpp.
References llvm::APIntOps::Or().
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::TargetFolder::CreateOr(), and llvm::ConstantFolder::CreateOr().
Definition at line 799 of file Constants.cpp.
References llvm::APIntOps::Xor().
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::TargetFolder::CreateXor(), and llvm::ConstantFolder::CreateXor().
Definition at line 2167 of file Constants.cpp.
References llvm::ConstantFoldCompareInstruction(), llvm::CmpInst::FIRST_ICMP_PREDICATE, llvm::Value::getType(), llvm::Type::Int1Ty, and llvm::CmpInst::LAST_ICMP_PREDICATE.
Referenced by llvm::ConstantFoldCompareInstruction(), evaluateICmpRelation(), getCompareTy(), llvm::SCEVAddRecExpr::getNumIterationsInRange(), and replaceUsesOfWithOnConstant().
Definition at line 2185 of file Constants.cpp.
References llvm::ConstantFoldCompareInstruction(), FCmp, llvm::Value::getType(), llvm::Type::Int1Ty, and llvm::CmpInst::LAST_FCMP_PREDICATE.
Referenced by llvm::ConstantFoldCompareInstruction(), evaluateFCmpRelation(), getCompareTy(), and replaceUsesOfWithOnConstant().
Definition at line 2202 of file Constants.cpp.
References llvm::ConstantFoldCompareInstruction(), llvm::SmallVectorImpl< T >::empty(), llvm::CmpInst::FIRST_ICMP_PREDICATE, llvm::ConstantVector::get(), llvm::UndefValue::get(), llvm::ConstantInt::get(), llvm::ConstantInt::getAllOnesValue(), llvm::SequentialType::getElementType(), llvm::VectorType::getNumElements(), llvm::Value::getType(), llvm::Constant::getVectorElements(), llvm::CmpInst::LAST_ICMP_PREDICATE, llvm::SmallVectorImpl< T >::push_back(), llvm::SmallVectorImpl< T >::size(), and VICmp.
Referenced by getCompareTy(), and replaceUsesOfWithOnConstant().
Definition at line 2247 of file Constants.cpp.
References llvm::ConstantFoldCompareInstruction(), llvm::SmallVectorImpl< T >::empty(), llvm::ConstantVector::get(), llvm::UndefValue::get(), llvm::ConstantInt::get(), llvm::VectorType::get(), llvm::IntegerType::get(), llvm::ConstantInt::getAllOnesValue(), llvm::SequentialType::getElementType(), llvm::VectorType::getNumElements(), llvm::Type::getPrimitiveSizeInBits(), llvm::Value::getType(), llvm::Constant::getVectorElements(), llvm::CmpInst::LAST_FCMP_PREDICATE, llvm::SmallVectorImpl< T >::push_back(), and llvm::SmallVectorImpl< T >::size().
Referenced by getCompareTy(), and replaceUsesOfWithOnConstant().
Definition at line 809 of file Constants.cpp.
Referenced by llvm::TargetFolder::CreateShl(), and llvm::ConstantFolder::CreateShl().
Definition at line 812 of file Constants.cpp.
References LShr.
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::TargetFolder::CreateLShr(), and llvm::ConstantFolder::CreateLShr().
Definition at line 815 of file Constants.cpp.
Referenced by llvm::TargetFolder::CreateAShr(), and llvm::ConstantFolder::CreateAShr().
| Constant * ConstantExpr::getGetElementPtr | ( | Constant * | C, | |
| Constant *const * | IdxList, | |||
| unsigned | NumIdx | |||
| ) | [static] |
Getelementptr form. std::vector<Value*> is only accepted for convenience: all elements must be Constant's.
Definition at line 2160 of file Constants.cpp.
Referenced by llvm::ConstantFoldGetElementPtr(), llvm::ConstantFoldInstOperands(), llvm::TargetFolder::CreateGetElementPtr(), llvm::NoFolder::CreateGetElementPtr(), llvm::ConstantFolder::CreateGetElementPtr(), getSizeOf(), getWithOperandReplaced(), getWithOperands(), llvm::RSProfilers_std::IncrementCounterInBlock(), llvm::IncrementCounterInBlock(), llvm::InsertProfilingInitCall(), OptimizeAwayTrappingUsesOfValue(), replaceUsesOfWithOnConstant(), and SRAGlobal().
| Constant * ConstantExpr::getGetElementPtr | ( | Constant * | C, | |
| Value *const * | IdxList, | |||
| unsigned | NumIdx | |||
| ) | [static] |
Definition at line 2150 of file Constants.cpp.
References llvm::PointerType::get(), getGetElementPtrTy(), and llvm::Value::getType().
Definition at line 2304 of file Constants.cpp.
References getExtractElementTy(), llvm::Value::getType(), and llvm::Type::Int32Ty.
Referenced by llvm::ConstantFoldInstOperands(), llvm::TargetFolder::CreateExtractElement(), llvm::ConstantFolder::CreateExtractElement(), getWithOperandReplaced(), getWithOperands(), and replaceUsesOfWithOnConstant().
| Constant * ConstantExpr::getInsertElement | ( | Constant * | Vec, | |
| Constant * | Elt, | |||
| Constant * | Idx | |||
| ) | [static] |
Definition at line 2325 of file Constants.cpp.
References getInsertElementTy(), llvm::Value::getType(), and llvm::Type::Int32Ty.
Referenced by llvm::ConstantFoldInstOperands(), llvm::TargetFolder::CreateInsertElement(), llvm::ConstantFolder::CreateInsertElement(), getWithOperandReplaced(), getWithOperands(), and replaceUsesOfWithOnConstant().
| Constant * ConstantExpr::getShuffleVector | ( | Constant * | V1, | |
| Constant * | V2, | |||
| Constant * | Mask | |||
| ) | [static] |
Definition at line 2348 of file Constants.cpp.
References getShuffleVectorTy(), llvm::Value::getType(), and llvm::ShuffleVectorInst::isValidOperands().
Referenced by llvm::ConstantFoldInstOperands(), llvm::TargetFolder::CreateShuffleVector(), llvm::ConstantFolder::CreateShuffleVector(), getWithOperandReplaced(), getWithOperands(), and replaceUsesOfWithOnConstant().
| Constant * ConstantExpr::getExtractValue | ( | Constant * | Agg, | |
| const unsigned * | IdxList, | |||
| unsigned | NumIdx | |||
| ) | [static] |
Definition at line 2396 of file Constants.cpp.
References getExtractValueTy(), llvm::Value::getType(), and llvm::Type::isFirstClassType().
Referenced by llvm::TargetFolder::CreateExtractValue(), llvm::ConstantFolder::CreateExtractValue(), and replaceUsesOfWithOnConstant().
| Constant * ConstantExpr::getInsertValue | ( | Constant * | Agg, | |
| Constant * | Val, | |||
| const unsigned * | IdxList, | |||
| unsigned | NumIdx | |||
| ) | [static] |
Definition at line 2370 of file Constants.cpp.
References getInsertValueTy(), llvm::Value::getType(), and llvm::Type::isFirstClassType().
Referenced by llvm::TargetFolder::CreateInsertValue(), llvm::ConstantFolder::CreateInsertValue(), and replaceUsesOfWithOnConstant().
Floating point negation must be implemented with f(x) = -0.0 - x. This method returns the negative zero constant for floating point or vector floating point types; for all other types, it returns the null value.
Definition at line 2407 of file Constants.cpp.
References llvm::ConstantVector::get(), llvm::ConstantFP::getNegativeZero(), llvm::Constant::getNullValue(), and llvm::Type::isFloatingPoint().
Referenced by llvm::BinaryOperator::CreateNeg(), getNeg(), and llvm::BinaryOperator::isNeg().
| virtual bool llvm::ConstantExpr::isNullValue | ( | ) | const [inline, virtual] |
isNullValue - Return true if this is the value that would be returned by getNullValue.
Implements llvm::Constant.
Definition at line 735 of file Constants.h.
| unsigned llvm::ConstantExpr::getOpcode | ( | ) | const [inline] |
getOpcode - Return the opcode at the root of this constant expression
Definition at line 738 of file Constants.h.
References llvm::Value::SubclassData.
Referenced by llvm::AddCatchInfo(), llvm::Constant::canTrap(), CleanupConstantGlobalUsers(), llvm::ConstantFoldConstantExpression(), llvm::ConvertConstantType< ConstantExpr, Type >::convert(), evaluateFCmpRelation(), evaluateICmpRelation(), foldConstantCastPair(), llvm::GlobalAlias::getAliasedGlobal(), getOpcodeName(), getPredicate(), getValType(), getWithOperandReplaced(), getWithOperands(), hasIndices(), isCast(), isCompare(), IsConstantOffsetFromGlobal(), and replaceUsesOfWithOnConstant().
| unsigned ConstantExpr::getPredicate | ( | ) | const |
getPredicate - Return the ICMP or FCMP predicate value. Assert if this is not an ICMP or FCMP constant expression.
Definition at line 802 of file Constants.cpp.
References FCmp, getOpcode(), and VICmp.
Referenced by llvm::ConstantFoldConstantExpression(), getValType(), getWithOperands(), and replaceUsesOfWithOnConstant().
| const SmallVector< unsigned, 4 > & ConstantExpr::getIndices | ( | ) | const |
getIndices - Assert that this is an insertvalue or exactvalue expression and return the list of indices.
Definition at line 743 of file Constants.cpp.
References Indices.
Referenced by getValType(), and replaceUsesOfWithOnConstant().
| const char * ConstantExpr::getOpcodeName | ( | ) | const |
getOpcodeName - Return a string representation for an opcode.
Definition at line 2428 of file Constants.cpp.
References getOpcode(), and llvm::Instruction::getOpcodeName().
getWithOperandReplaced - Return a constant expression identical to this one, but with the specified operand set to the specified value.
getWithOperandReplaced - Return a constant expression identical to this one, but with the specified operand set to the specified value.
Definition at line 822 of file Constants.cpp.
References BitCast, FPToUI, FPTrunc, get(), getCast(), getExtractElement(), getGetElementPtr(), getInsertElement(), llvm::User::getNumOperands(), getOpcode(), llvm::Constant::getOperand(), getSelect(), getShuffleVector(), llvm::Value::getType(), InsertElement, PtrToInt, llvm::SmallVectorImpl< T >::resize(), llvm::Attribute::SExt, llvm::SmallVectorImpl< T >::size(), UIToFP, and ZExt.
| Constant* llvm::ConstantExpr::getWithOperands | ( | const std::vector< Constant * > & | Ops | ) | const [inline] |
getWithOperands - This returns the current constant expression with the operands replaced with the specified values. The specified operands must match count and type with the existing ones.
Definition at line 758 of file Constants.h.
getWithOperands - This returns the current constant expression with the operands replaced with the specified values. The specified operands must match count and type with the existing ones.
Definition at line 885 of file Constants.cpp.
References BitCast, FCmp, FPToUI, FPTrunc, get(), getCast(), getCompare(), getExtractElement(), getGetElementPtr(), getInsertElement(), llvm::User::getNumOperands(), getOpcode(), llvm::Constant::getOperand(), getPredicate(), getSelect(), getShuffleVector(), llvm::Value::getType(), InsertElement, PtrToInt, llvm::Attribute::SExt, UIToFP, VICmp, and ZExt.
| void ConstantExpr::destroyConstant | ( | ) | [virtual] |
destroyConstant - Called if some element of this constant is no longer valid. At this point only other constants may be on the use_list for this constant. Any constants on our Use list must also be destroy'd. The implementation must be sure to remove the constant from the list of available cached constants. Implementations should call destroyConstantImpl as the last thing they do, to destroy all users and delete this.
Reimplemented from llvm::Constant.
Definition at line 2423 of file Constants.cpp.
References llvm::Constant::destroyConstantImpl().
Referenced by llvm::ConvertConstantType< ConstantExpr, Type >::convert(), and replaceUsesOfWithOnConstant().
replaceUsesOfWithOnConstant - This method is a special form of User::replaceUsesOfWith (which does not work on constants) that does work on constants. Basically this method goes through the trouble of building a new constant that is equivalent to the current one, with all uses of From replaced with uses of To. After this construction is completed, all of the users of 'this' are replaced to use the new constant, and then 'this' is deleted. In general, you should not call this method, instead, use Value::replaceAllUsesWith, which automatically dispatches to this method as needed.
Reimplemented from llvm::Constant.
Definition at line 2613 of file Constants.cpp.
References C2, destroyConstant(), ExtractValue, FCmp, get(), getCast(), getExtractElement(), getExtractValue(), getFCmp(), getGetElementPtr(), getICmp(), getIndices(), getInsertElement(), getInsertValue(), llvm::User::getNumOperands(), getOpcode(), llvm::Constant::getOperand(), getPredicate(), getSelect(), getShuffleVector(), llvm::Value::getType(), getVFCmp(), getVICmp(), Indices, InsertElement, isCast(), isCompare(), llvm::SmallVectorImpl< T >::push_back(), llvm::SmallVectorImpl< T >::reserve(), llvm::SmallVectorImpl< T >::size(), To, llvm::Value::uncheckedReplaceAllUsesWith(), Val, and VICmp.
| static bool llvm::ConstantExpr::classof | ( | const ConstantExpr * | ) | [inline, static] |
Methods for support type inquiry through isa, cast, and dyn_cast:.
Definition at line 767 of file Constants.h.
| static bool llvm::ConstantExpr::classof | ( | const Value * | V | ) | [inline, static] |
Reimplemented from llvm::Constant.
Definition at line 768 of file Constants.h.
References llvm::Value::ConstantExprVal, and llvm::Value::getValueID().
friend struct ConstantCreator< ConstantExpr, Type,std::pair< unsigned, std::vector< Constant * > > > [friend] |
Definition at line 556 of file Constants.h.
friend struct ConvertConstantType< ConstantExpr, Type > [friend] |
Definition at line 557 of file Constants.h.