LLVM API Documentation
#include <Constants.h>
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 559 of file Constants.h.
| Constant * ConstantExpr::getTy | ( | const Type * | Ty, | |
| unsigned | Opcode, | |||
| Constant * | C1, | |||
| Constant * | C2 | |||
| ) | [static, protected] |
Definition at line 1280 of file Constants.cpp.
References llvm::ConstantFoldBinaryInstruction(), llvm::LLVMContextImpl::ExprConstants, llvm::Type::getContext(), llvm::Type::getInt1Ty(), llvm::Value::getType(), and llvm::LLVMContext::pImpl.
Referenced by llvm::ConvertConstant< ConstantExpr, Type >::convert(), and get().
| Constant * ConstantExpr::getCompareTy | ( | unsigned short | pred, | |
| Constant * | C1, | |||
| Constant * | C2 | |||
| ) | [static, protected] |
Definition at line 1303 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::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_unreachable.
Referenced by getCompare().
| Constant * ConstantExpr::getSelectTy | ( | const Type * | Ty, | |
| Constant * | C1, | |||
| Constant * | C2, | |||
| Constant * | C3 | |||
| ) | [static, protected] |
Definition at line 1434 of file Constants.cpp.
References llvm::SelectInst::areInvalidOperands(), llvm::ConstantFoldSelectInstruction(), llvm::LLVMContextImpl::ExprConstants, llvm::Type::getContext(), llvm::Value::getType(), and llvm::LLVMContext::pImpl.
Referenced by llvm::ConvertConstant< ConstantExpr, Type >::convert(), and getSelect().
| Constant * ConstantExpr::getGetElementPtrTy | ( | const Type * | Ty, | |
| Constant * | C, | |||
| Value *const * | Idxs, | |||
| unsigned | NumIdxs | |||
| ) | [static, protected] |
Definition at line 1454 of file Constants.cpp.
References llvm::ConstantFoldGetElementPtr(), llvm::LLVMContextImpl::ExprConstants, llvm::Type::getContext(), llvm::Value::getType(), and llvm::LLVMContext::pImpl.
Referenced by llvm::ConvertConstant< ConstantExpr, Type >::convert(), and getGetElementPtr().
| Constant * ConstantExpr::getExtractElementTy | ( | const Type * | Ty, | |
| Constant * | Val, | |||
| Constant * | Idx | |||
| ) | [static, protected] |
Definition at line 1561 of file Constants.cpp.
References llvm::ConstantFoldExtractElementInstruction(), llvm::LLVMContextImpl::ExprConstants, ExtractElement(), llvm::Type::getContext(), and llvm::LLVMContext::pImpl.
Referenced by getExtractElement().
| Constant * ConstantExpr::getInsertElementTy | ( | const Type * | Ty, | |
| Constant * | Val, | |||
| Constant * | Elt, | |||
| Constant * | Idx | |||
| ) | [static, protected] |
Definition at line 1586 of file Constants.cpp.
References llvm::ConstantFoldInsertElementInstruction(), llvm::LLVMContextImpl::ExprConstants, llvm::Type::getContext(), InsertElement, and llvm::LLVMContext::pImpl.
Referenced by getInsertElement().
| Constant * ConstantExpr::getShuffleVectorTy | ( | const Type * | Ty, | |
| Constant * | V1, | |||
| Constant * | V2, | |||
| Constant * | Mask | |||
| ) | [static, protected] |
Definition at line 1614 of file Constants.cpp.
References llvm::ConstantFoldShuffleVectorInstruction(), llvm::LLVMContextImpl::ExprConstants, llvm::Type::getContext(), and llvm::LLVMContext::pImpl.
Referenced by getShuffleVector().
| Constant * ConstantExpr::getExtractValueTy | ( | const Type * | Ty, | |
| Constant * | Agg, | |||
| const unsigned * | Idxs, | |||
| unsigned | NumIdxs | |||
| ) | [static, protected] |
Definition at line 1672 of file Constants.cpp.
References llvm::ConstantFoldExtractValueInstruction(), llvm::Type::getContext(), 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 1642 of file Constants.cpp.
References llvm::ConstantFoldInsertValueInstruction(), llvm::Type::getContext(), llvm::Value::getType(), and llvm::Type::isFirstClassType().
Referenced by getInsertValue().
Cast constant expr getAlignOf constant expr - computes the alignment of a type in a target independent way (Note: the return type is an i32; Note: assumes that i8 is byte aligned).
Definition at line 1401 of file Constants.cpp.
References llvm::StructType::get(), llvm::ConstantInt::get(), getCast(), llvm::Type::getContext(), getGetElementPtr(), llvm::Type::getInt32Ty(), llvm::Type::getInt8Ty(), llvm::Constant::getNullValue(), llvm::Type::getPointerTo(), and PtrToInt.
getSizeOf constant expr - computes the size of a type in a target independent way (Note: the return type is an i64).
Definition at line 1391 of file Constants.cpp.
References llvm::ConstantInt::get(), getCast(), llvm::Type::getContext(), getGetElementPtr(), llvm::Type::getInt32Ty(), llvm::Type::getInt64Ty(), llvm::Constant::getNullValue(), llvm::PointerType::getUnqual(), and PtrToInt.
Referenced by llvm::IRBuilder< true, llvm::TargetFolder >::CreatePtrDiff(), and llvm::InlineFunction().
| Constant * ConstantExpr::getOffsetOf | ( | const StructType * | Ty, | |
| unsigned | FieldNo | |||
| ) | [static] |
getOffsetOf constant expr - computes the offset of a field in a target independent way (Note: the return type is an i64).
Definition at line 1415 of file Constants.cpp.
References llvm::ConstantInt::get(), getCast(), llvm::Type::getContext(), getGetElementPtr(), llvm::Type::getInt32Ty(), llvm::Type::getInt64Ty(), llvm::Constant::getNullValue(), llvm::PointerType::getUnqual(), and PtrToInt.
Definition at line 1696 of file Constants.cpp.
References getFNeg(), llvm::Value::getType(), llvm::ConstantFP::getZeroValueForNegation(), llvm::Type::isFPOrFPVector(), and llvm::Type::isIntOrIntVector().
Referenced by llvm::TargetFolder::CreateNeg(), llvm::ConstantFolder::CreateNeg(), llvm::ScalarEvolution::getNegativeSCEV(), and llvm::PatternMatch::neg_match< LHS_t >::match().
Definition at line 1707 of file Constants.cpp.
References llvm::Value::getType(), llvm::ConstantFP::getZeroValueForNegation(), and llvm::Type::isFPOrFPVector().
Referenced by llvm::TargetFolder::CreateFNeg(), llvm::ConstantFolder::CreateFNeg(), getNeg(), and llvm::PatternMatch::fneg_match< LHS_t >::match().
Definition at line 1715 of file Constants.cpp.
References llvm::Constant::getAllOnesValue(), llvm::Value::getType(), llvm::Type::isIntOrIntVector(), 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 1721 of file Constants.cpp.
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::ConstantFoldGetElementPtr(), llvm::TargetFolder::CreateAdd(), llvm::ConstantFolder::CreateAdd(), and getNSWAdd().
Definition at line 1725 of file Constants.cpp.
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::TargetFolder::CreateFAdd(), and llvm::ConstantFolder::CreateFAdd().
Definition at line 1729 of file Constants.cpp.
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::TargetFolder::CreateSub(), and llvm::ConstantFolder::CreateSub().
Definition at line 1733 of file Constants.cpp.
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::TargetFolder::CreateFSub(), and llvm::ConstantFolder::CreateFSub().
Definition at line 1737 of file Constants.cpp.
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::TargetFolder::CreateMul(), and llvm::ConstantFolder::CreateMul().
Definition at line 1741 of file Constants.cpp.
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::TargetFolder::CreateFMul(), and llvm::ConstantFolder::CreateFMul().
Definition at line 1745 of file Constants.cpp.
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::TargetFolder::CreateUDiv(), llvm::ConstantFolder::CreateUDiv(), and llvm::ScalarEvolution::getUDivExpr().
Definition at line 1749 of file Constants.cpp.
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::TargetFolder::CreateSDiv(), llvm::ConstantFolder::CreateSDiv(), and getExactSDiv().
Definition at line 1753 of file Constants.cpp.
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::TargetFolder::CreateFDiv(), and llvm::ConstantFolder::CreateFDiv().
Definition at line 1757 of file Constants.cpp.
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::TargetFolder::CreateURem(), and llvm::ConstantFolder::CreateURem().
Definition at line 1761 of file Constants.cpp.
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::TargetFolder::CreateSRem(), and llvm::ConstantFolder::CreateSRem().
Definition at line 1765 of file Constants.cpp.
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::TargetFolder::CreateFRem(), and llvm::ConstantFolder::CreateFRem().
Definition at line 1769 of file Constants.cpp.
References llvm::APIntOps::And().
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::ConstantFoldInstOperands(), llvm::TargetFolder::CreateAnd(), and llvm::ConstantFolder::CreateAnd().
Definition at line 1773 of file Constants.cpp.
References llvm::APIntOps::Or().
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::TargetFolder::CreateOr(), and llvm::ConstantFolder::CreateOr().
Definition at line 1777 of file Constants.cpp.
References llvm::APIntOps::Xor().
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::TargetFolder::CreateXor(), and llvm::ConstantFolder::CreateXor().
Definition at line 1781 of file Constants.cpp.
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::TargetFolder::CreateShl(), and llvm::ConstantFolder::CreateShl().
Definition at line 1785 of file Constants.cpp.
References LShr.
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::TargetFolder::CreateLShr(), and llvm::ConstantFolder::CreateLShr().
Definition at line 1789 of file Constants.cpp.
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::TargetFolder::CreateAShr(), and llvm::ConstantFolder::CreateAShr().
Definition at line 1135 of file Constants.cpp.
References getFoldedCast(), llvm::Type::getScalarSizeInBits(), llvm::Value::getType(), llvm::Type::getTypeID(), llvm::Type::isIntOrIntVector(), and llvm::Type::VectorTyID.
Referenced by getCast(), and llvm::ScalarEvolution::getTruncateExpr().
Definition at line 1149 of file Constants.cpp.
References getFoldedCast(), llvm::Type::getScalarSizeInBits(), llvm::Value::getType(), llvm::Type::getTypeID(), llvm::Type::isIntOrIntVector(), llvm::Attribute::SExt, and llvm::Type::VectorTyID.
Referenced by llvm::ConstantFoldGetElementPtr(), getCast(), llvm::ScalarEvolution::getSignExtendExpr(), IdxCompare(), and IndexOperandsEqual().
Definition at line 1163 of file Constants.cpp.
References getFoldedCast(), llvm::Type::getScalarSizeInBits(), llvm::Value::getType(), llvm::Type::getTypeID(), llvm::Type::isIntOrIntVector(), llvm::Type::VectorTyID, and ZExt.
Referenced by llvm::ConstantFoldGetElementPtr(), getCast(), and llvm::ScalarEvolution::getZeroExtendExpr().
Definition at line 1177 of file Constants.cpp.
References FPTrunc, getFoldedCast(), llvm::Type::getScalarSizeInBits(), llvm::Value::getType(), llvm::Type::getTypeID(), llvm::Type::isFPOrFPVector(), and llvm::Type::VectorTyID.
Referenced by getCast().
Definition at line 1189 of file Constants.cpp.
References getFoldedCast(), llvm::Type::getScalarSizeInBits(), llvm::Value::getType(), llvm::Type::getTypeID(), llvm::Type::isFPOrFPVector(), and llvm::Type::VectorTyID.
Referenced by getCast().
Definition at line 1201 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 1212 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 1223 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 1234 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 1245 of file Constants.cpp.
References getFoldedCast(), llvm::Value::getType(), llvm::Type::isInteger(), and PtrToInt.
Referenced by getCast().
Definition at line 1251 of file Constants.cpp.
References getFoldedCast(), llvm::Value::getType(), and llvm::Type::isInteger().
Referenced by llvm::ConstantFoldGetElementPtr(), getCast(), llvm::Constant::getIntegerValue(), llvm::ScalarEvolution::getSignExtendExpr(), llvm::ScalarEvolution::getZeroExtendExpr(), and llvm::JIT::runFunction().
Definition at line 1257 of file Constants.cpp.
References BitCast, getFoldedCast(), llvm::Type::getPrimitiveSizeInBits(), and llvm::Value::getType().
Referenced by AliasGToF(), llvm::ConstantFoldInstOperands(), llvm::DIFactory::CreateGlobalVariable(), getCast(), llvm::Module::getOrInsertFunction(), llvm::Module::getOrInsertGlobal(), OptimizeGlobalAddressOfMalloc(), and OptimizeOnceStoredGlobal().
Definition at line 632 of file Constants.cpp.
References llvm::CallingConv::C, and getAdd().
Referenced by llvm::TargetFolder::CreateNSWAdd(), and llvm::ConstantFolder::CreateNSWAdd().
Definition at line 641 of file Constants.cpp.
References llvm::CallingConv::C, and getSDiv().
Referenced by llvm::TargetFolder::CreateExactSDiv(), and llvm::ConstantFolder::CreateExactSDiv().
| 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 1057 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(), llvm_unreachable, PtrToInt, llvm::Attribute::SExt, UIToFP, and ZExt.
Referenced by llvm::ConstantFoldCastInstruction(), llvm::ConstantFoldInstOperands(), llvm::ConvertConstant< ConstantExpr, Type >::convert(), llvm::TargetFolder::CreateCast(), llvm::ConstantFolder::CreateCast(), getAlignOf(), getFPCast(), getIntegerCast(), getOffsetOf(), getPointerCast(), llvm::ScalarEvolution::getSCEVAtScope(), getSExtOrBitCast(), getSizeOf(), getTruncOrBitCast(), getWithOperandReplaced(), getWithOperands(), getZExtOrBitCast(), OptimizeAwayTrappingUsesOfValue(), and replaceUsesOfWithOnConstant().
| C | The constant to zext or bitcast |
| Ty | The type to zext or bitcast C to |
Definition at line 1083 of file Constants.cpp.
References BitCast, getCast(), llvm::Type::getScalarSizeInBits(), llvm::Value::getType(), and ZExt.
Referenced by llvm::ConstantFolder::CreateZExtOrBitCast().
| C | The constant to sext or bitcast |
| Ty | The type to sext or bitcast C to |
Definition at line 1089 of file Constants.cpp.
References BitCast, getCast(), llvm::Type::getScalarSizeInBits(), llvm::Value::getType(), and llvm::Attribute::SExt.
Referenced by llvm::ConstantFoldGetElementPtr(), and llvm::ConstantFolder::CreateSExtOrBitCast().
| C | The constant to trunc or bitcast |
| Ty | The type to trunc or bitcast C to |
Definition at line 1095 of file Constants.cpp.
References BitCast, getCast(), llvm::Type::getScalarSizeInBits(), 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 1101 of file Constants.cpp.
References BitCast, getCast(), llvm::Value::getType(), llvm::Type::isInteger(), and PtrToInt.
Referenced by llvm::ConstantFoldCastInstruction(), and llvm::ConstantFolder::CreatePointerCast().
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 1110 of file Constants.cpp.
References BitCast, getCast(), llvm::Type::getScalarSizeInBits(), llvm::Value::getType(), llvm::Type::isIntOrIntVector(), 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 1123 of file Constants.cpp.
References FPTrunc, getCast(), llvm::Type::getScalarSizeInBits(), llvm::Value::getType(), llvm::Type::isFPOrFPVector(), and opcode.
Referenced by llvm::ConstantFolder::CreateFPCast().
| bool ConstantExpr::isCast | ( | ) | const |
Return true if this is a convert constant expression.
Definition at line 653 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 657 of file Constants.cpp.
References FCmp, and getOpcode().
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 661 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 714 of file Constants.h.
References getSelectTy(), and llvm::Value::getType().
Referenced by llvm::ConstantFoldInstOperands(), llvm::TargetFolder::CreateSelect(), llvm::ConstantFolder::CreateSelect(), getWithOperandReplaced(), getWithOperands(), and replaceUsesOfWithOnConstant().
get - Return a binary or shift operator constant expression, folding if possible.
Definition at line 1323 of file Constants.cpp.
References llvm::APIntOps::And(), getTy(), llvm::Value::getType(), llvm::Type::isFPOrFPVector(), llvm::Type::isIntOrIntVector(), LShr, llvm::APIntOps::Or(), and llvm::APIntOps::Xor().
Referenced by llvm::ConstantFoldGetElementPtr(), llvm::ConstantFoldInstOperands(), llvm::TargetFolder::CreateBinOp(), llvm::ConstantFolder::CreateBinOp(), getWithOperandReplaced(), getWithOperands(), and replaceUsesOfWithOnConstant().
Return an ICmp or FCmp comparison operator constant expression.
Definition at line 1428 of file Constants.cpp.
References getCompareTy(), and llvm::Value::getType().
Referenced by llvm::ConstantFoldCompareInstOperands(), llvm::ConstantFoldCompareInstruction(), llvm::TargetFolder::CreateFCmp(), llvm::ConstantFolder::CreateFCmp(), llvm::TargetFolder::CreateICmp(), llvm::ConstantFolder::CreateICmp(), and getWithOperands().
get* - Return some common constants without having to specify the full Instruction::OPCODE identifier.
Definition at line 1515 of file Constants.cpp.
References llvm::ConstantFoldCompareInstruction(), llvm::LLVMContextImpl::ExprConstants, llvm::CmpInst::FIRST_ICMP_PREDICATE, llvm::Value::getContext(), llvm::Type::getInt1Ty(), llvm::Value::getType(), and llvm::CmpInst::LAST_ICMP_PREDICATE.
Referenced by evaluateICmpRelation(), getCompareTy(), llvm::SCEVAddRecExpr::getNumIterationsInRange(), and replaceUsesOfWithOnConstant().
Definition at line 1539 of file Constants.cpp.
References llvm::ConstantFoldCompareInstruction(), llvm::LLVMContextImpl::ExprConstants, FCmp, llvm::Value::getContext(), llvm::Type::getInt1Ty(), llvm::Value::getType(), and llvm::CmpInst::LAST_FCMP_PREDICATE.
Referenced by evaluateFCmpRelation(), getCompareTy(), and replaceUsesOfWithOnConstant().
| 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 1503 of file Constants.cpp.
Referenced by llvm::ConstantFoldGetElementPtr(), llvm::ConstantFoldInstOperands(), llvm::TargetFolder::CreateGetElementPtr(), llvm::NoFolder::CreateGetElementPtr(), llvm::ConstantFolder::CreateGetElementPtr(), getAlignOf(), getInBoundsGetElementPtr(), getOffsetOf(), 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 1482 of file Constants.cpp.
References llvm::PointerType::get(), getGetElementPtrTy(), and llvm::Value::getType().
| Constant * ConstantExpr::getInBoundsGetElementPtr | ( | Constant * | C, | |
| Constant *const * | IdxList, | |||
| unsigned | NumIdx | |||
| ) | [static] |
Create an "inbounds" getelementptr. See the documentation for the "inbounds" flag in LangRef.html for details.
Definition at line 1508 of file Constants.cpp.
Referenced by llvm::TargetFolder::CreateInBoundsGetElementPtr(), llvm::NoFolder::CreateInBoundsGetElementPtr(), and llvm::ConstantFolder::CreateInBoundsGetElementPtr().
Definition at line 1577 of file Constants.cpp.
References llvm::Value::getContext(), getExtractElementTy(), llvm::Type::getInt32Ty(), and llvm::Value::getType().
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 1603 of file Constants.cpp.
References llvm::Value::getContext(), getInsertElementTy(), llvm::Type::getInt32Ty(), and llvm::Value::getType().
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 1631 of file Constants.cpp.
References llvm::VectorType::get(), 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 1685 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 1658 of file Constants.cpp.
References getInsertValueTy(), llvm::Value::getType(), and llvm::Type::isFirstClassType().
Referenced by llvm::TargetFolder::CreateInsertValue(), llvm::ConstantFolder::CreateInsertValue(), and replaceUsesOfWithOnConstant().
| 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 759 of file Constants.h.
| unsigned llvm::ConstantExpr::getOpcode | ( | ) | const [inline] |
getOpcode - Return the opcode at the root of this constant expression
Definition at line 762 of file Constants.h.
References llvm::Value::SubclassData.
Referenced by llvm::AddCatchInfo(), llvm::Constant::canTrap(), llvm::GEPOperator::classof(), llvm::SDivOperator::classof(), llvm::MulOperator::classof(), llvm::SubOperator::classof(), llvm::AddOperator::classof(), llvm::OverflowingBinaryOperator::classof(), CleanupConstantGlobalUsers(), llvm::ConstantFoldConstantExpression(), llvm::ConvertConstant< ConstantExpr, Type >::convert(), evaluateFCmpRelation(), evaluateICmpRelation(), foldConstantCastPair(), llvm::GlobalAlias::getAliasedGlobal(), getOpcodeName(), getPredicate(), getValType(), getWithOperandReplaced(), getWithOperands(), hasIndices(), isCast(), isCompare(), IsConstantOffsetFromGlobal(), llvm::MSILWriter::printConstantExpr(), 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 674 of file Constants.cpp.
References FCmp, and getOpcode().
Referenced by llvm::ConstantFoldConstantExpression(), getValType(), getWithOperands(), llvm::MSILWriter::printConstantExpr(), 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 666 of file Constants.cpp.
Referenced by getValType(), and replaceUsesOfWithOnConstant().
| const char * ConstantExpr::getOpcodeName | ( | ) | const |
getOpcodeName - Return a string representation for an opcode.
Definition at line 1802 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 683 of file Constants.cpp.
References BitCast, ExtractElement(), 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 782 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 746 of file Constants.cpp.
References BitCast, ExtractElement(), 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, 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 1795 of file Constants.cpp.
References llvm::Constant::destroyConstantImpl(), llvm::LLVMContextImpl::ExprConstants, llvm::Type::getContext(), llvm::Value::getType(), and llvm::LLVMContext::pImpl.
Referenced by llvm::ConvertConstant< 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 2021 of file Constants.cpp.
References C2, destroyConstant(), ExtractElement(), 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(), InsertElement, isCast(), isCompare(), llvm_unreachable, llvm::SmallVectorImpl< T >::push_back(), llvm::SmallVectorImpl< T >::reserve(), llvm::SmallVectorImpl< T >::size(), To, llvm::Value::uncheckedReplaceAllUsesWith(), and Val.
| static bool llvm::ConstantExpr::classof | ( | const ConstantExpr * | ) | [inline, static] |
Methods for support type inquiry through isa, cast, and dyn_cast:.
Definition at line 791 of file Constants.h.
Reimplemented from llvm::Constant.
Definition at line 792 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 561 of file Constants.h.
friend struct ConvertConstant< ConstantExpr, Type > [friend] |
Definition at line 562 of file Constants.h.