LLVM API Documentation
#include <ScalarEvolution.h>
Definition at line 158 of file ScalarEvolution.h.
| ScalarEvolution::ScalarEvolution | ( | ) |
Definition at line 5093 of file ScalarEvolution.cpp.
| LLVMContext& llvm::ScalarEvolution::getContext | ( | ) | const [inline] |
Definition at line 369 of file ScalarEvolution.h.
References llvm::Function::getContext().
Referenced by BinomialCoefficient(), FactorOutConstant(), getAllocSizeExpr(), getConstant(), getEffectiveSCEVType(), getFieldOffsetExpr(), getMulExpr(), llvm::SCEVAddRecExpr::getNumIterationsInRange(), getSCEVAtScope(), getSignExtendExpr(), getSMaxExpr(), getUDivExpr(), getUMaxExpr(), getZeroExtendExpr(), GetZeroSCEV(), and SolveQuadraticEquation().
isSCEVable - Test if values of the given type are analyzable within the SCEV framework. This primarily includes integer types, and it can optionally include pointer types if the ScalarEvolution class has access to target-specific information.
isSCEVable - Test if values of the given type are analyzable within the SCEV framework. This primarily includes integer types, and it can optionally include pointer types if the ScalarEvolution class has access to target-specific information.
Definition at line 2158 of file ScalarEvolution.cpp.
References llvm::Type::isInteger().
Referenced by llvm::IVUsers::AddUsersIfInteresting(), getAnyExtendExpr(), getEffectiveSCEVType(), getSCEV(), getSCEVAtScope(), getSignExtendExpr(), getTruncateExpr(), getTypeSizeInBits(), getZeroExtendExpr(), and print().
| uint64_t ScalarEvolution::getTypeSizeInBits | ( | const Type * | Ty | ) | const |
getTypeSizeInBits - Return the size in bits of the specified type, for which isSCEVable must return true.
getTypeSizeInBits - Return the size in bits of the specified type, for which isSCEVable must return true.
Definition at line 2165 of file ScalarEvolution.cpp.
References llvm::Type::getPrimitiveSizeInBits(), llvm::TargetData::getTypeSizeInBits(), llvm::Type::isInteger(), and isSCEVable().
Referenced by llvm::IVUsers::AddUsersIfInteresting(), BinomialCoefficient(), getAddExpr(), getAnyExtendExpr(), GetMinTrailingZeros(), getNoopOrAnyExtend(), getNoopOrSignExtend(), getNoopOrZeroExtend(), llvm::SCEVAddRecExpr::getNumIterationsInRange(), getSignedRange(), getSignExtendExpr(), getTruncateExpr(), getTruncateOrNoop(), getTruncateOrSignExtend(), getTruncateOrZeroExtend(), getUDivExpr(), getUMaxFromMismatchedTypes(), getUMinFromMismatchedTypes(), getUnsignedRange(), and getZeroExtendExpr().
getEffectiveSCEVType - Return a type with the same bitwidth as the given type and which represents how SCEV will treat the given type, for which isSCEVable must return true. For pointer types, this is the pointer-sized integer type.
getEffectiveSCEVType - Return a type with the same bitwidth as the given type and which represents how SCEV will treat the given type, for which isSCEVable must return true. For pointer types, this is the pointer-sized integer type.
Definition at line 2186 of file ScalarEvolution.cpp.
References getContext(), llvm::Type::getInt64Ty(), llvm::TargetData::getIntPtrType(), llvm::Type::isInteger(), and isSCEVable().
Referenced by getAddExpr(), getAddRecExpr(), getAllocSizeExpr(), getAnyExtendExpr(), getFieldOffsetExpr(), getIntegerSCEV(), getMulExpr(), getNegativeSCEV(), getNotSCEV(), getSignExtendExpr(), getSMaxExpr(), getTruncateExpr(), getUDivExpr(), getUMaxExpr(), getZeroExtendExpr(), and InsertAffinePhi().
getSCEV - Return a SCEV expression handle for the full generality of the specified expression.
getSCEV - Return an existing SCEV if it exists, otherwise analyze the expression and create a new one.
Definition at line 2206 of file ScalarEvolution.cpp.
References llvm::Value::getType(), isSCEVable(), S, and SCEVCallbackVH.
Referenced by llvm::IVUsers::AddUsersIfInteresting(), llvm::PointerTracking::getPointerOffset(), getSCEVAtScope(), and print().
| const SCEV * ScalarEvolution::getConstant | ( | ConstantInt * | V | ) |
Definition at line 178 of file ScalarEvolution.cpp.
References llvm::FoldingSetNodeID::AddInteger(), llvm::FoldingSetNodeID::AddPointer(), llvm::BumpPtrAllocator::Allocate(), ID, S, and llvm::scConstant.
Referenced by BinomialCoefficient(), EvaluateConstantChrecAtConstant(), FactorOutConstant(), getAddExpr(), getAllocSizeExpr(), getConstant(), getIntegerSCEV(), getMulExpr(), getNegativeSCEV(), getNotSCEV(), llvm::SCEVAddRecExpr::getNumIterationsInRange(), getSignExtendExpr(), getSMaxExpr(), getTruncateExpr(), getUDivExpr(), getUMaxExpr(), getZeroExtendExpr(), GetZeroSCEV(), SolveLinEquationWithOverflow(), and SolveQuadraticEquation().
Definition at line 190 of file ScalarEvolution.cpp.
References llvm::ConstantInt::get(), getConstant(), and getContext().
Definition at line 195 of file ScalarEvolution.cpp.
References llvm::ConstantInt::get(), and getConstant().
Definition at line 707 of file ScalarEvolution.cpp.
References llvm::FoldingSetNodeID::AddInteger(), llvm::FoldingSetNodeID::AddPointer(), llvm::BumpPtrAllocator::Allocate(), getAddRecExpr(), getConstant(), getEffectiveSCEVType(), llvm::ConstantExpr::getTrunc(), getTruncateOrSignExtend(), getTruncateOrZeroExtend(), llvm::SCEV::getType(), getTypeSizeInBits(), isSCEVable(), llvm::SmallVectorImpl< T >::push_back(), S, and llvm::scTruncate.
Referenced by getAddExpr(), getSCEVAtScope(), getTruncateOrNoop(), getTruncateOrSignExtend(), and getTruncateOrZeroExtend().
Definition at line 756 of file ScalarEvolution.cpp.
References llvm::FoldingSetNodeID::AddInteger(), llvm::BumpPtrAllocator::Allocate(), llvm::CallingConv::C, llvm::IntegerType::get(), getAddExpr(), getAddRecExpr(), getConstant(), getContext(), getEffectiveSCEVType(), llvm::ConstantExpr::getIntToPtr(), getMaxBackedgeTakenCount(), llvm::APInt::getMaxValue(), llvm::APInt::getMinValue(), getMulExpr(), getSignedRange(), getSignExtendExpr(), getTruncateOrSignExtend(), getTruncateOrZeroExtend(), llvm::SCEV::getType(), getTypeSizeInBits(), getUnsignedRange(), llvm::ConstantExpr::getZExt(), llvm::CmpInst::ICMP_UGT, llvm::CmpInst::ICMP_ULT, isKnownNegative(), isKnownPositive(), isLoopBackedgeGuardedByCond(), isLoopGuardedByCond(), isSCEVable(), L, S, llvm::scZeroExtend, and Start.
Referenced by getAnyExtendExpr(), getNoopOrZeroExtend(), getSCEVAtScope(), getSignExtendExpr(), getTruncateOrZeroExtend(), getUDivExpr(), getUMaxFromMismatchedTypes(), and getUMinFromMismatchedTypes().
Definition at line 895 of file ScalarEvolution.cpp.
References llvm::FoldingSetNodeID::AddInteger(), llvm::BumpPtrAllocator::Allocate(), llvm::CallingConv::C, llvm::IntegerType::get(), getAddExpr(), getAddRecExpr(), getConstant(), getContext(), getEffectiveSCEVType(), llvm::ConstantExpr::getIntToPtr(), getMaxBackedgeTakenCount(), getMulExpr(), llvm::ConstantExpr::getSExt(), llvm::APInt::getSignedMaxValue(), llvm::APInt::getSignedMinValue(), getSignedRange(), getTruncateOrSignExtend(), getTruncateOrZeroExtend(), llvm::SCEV::getType(), getTypeSizeInBits(), getZeroExtendExpr(), llvm::CmpInst::ICMP_SGT, llvm::CmpInst::ICMP_SLT, isKnownNegative(), isKnownPositive(), isLoopBackedgeGuardedByCond(), isLoopGuardedByCond(), isSCEVable(), L, S, llvm::scSignExtend, and Start.
Referenced by getAddExpr(), getAnyExtendExpr(), getNoopOrSignExtend(), getSCEVAtScope(), getTruncateOrSignExtend(), and getZeroExtendExpr().
getAnyExtendExpr - Return a SCEV for the given operand extended with unspecified bits out to the given type.
Definition at line 1037 of file ScalarEvolution.cpp.
References getEffectiveSCEVType(), getSignExtendExpr(), getTruncateOrNoop(), llvm::SCEV::getType(), getTypeSizeInBits(), getZeroExtendExpr(), isSCEVable(), llvm::Attribute::SExt, T, and llvm::ZExt.
Referenced by getNoopOrAnyExtend().
| const SCEV * ScalarEvolution::getAddExpr | ( | SmallVectorImpl< const SCEV * > & | Ops | ) |
getAddExpr - Get a canonical add expression, or something simpler if possible.
Definition at line 1172 of file ScalarEvolution.cpp.
References llvm::FoldingSetNodeID::AddInteger(), AddOne(), llvm::FoldingSetNodeID::AddPointer(), llvm::BumpPtrAllocator::Allocate(), llvm::SmallVectorImpl< T >::begin(), llvm::CallingConv::C, llvm::SmallVectorImpl< T >::clear(), CollectAddOperandsWithScales(), E, llvm::SmallVectorImpl< T >::empty(), llvm::SmallVectorImpl< T >::end(), llvm::SmallVectorImpl< T >::erase(), llvm::DenseMap< KeyT, ValueT, KeyInfoT, ValueInfoT >::find(), getAddRecExpr(), getConstant(), getEffectiveSCEVType(), getIntegerSCEV(), llvm::SCEVAddRecExpr::getLoop(), getMulExpr(), llvm::SCEVNAryExpr::getNumOperands(), llvm::SCEVNAryExpr::getOperand(), llvm::SCEVCastExpr::getOperand(), getSignExtendExpr(), llvm::SCEVAddRecExpr::getStart(), getTruncateExpr(), llvm::SCEV::getType(), llvm::SCEVCastExpr::getType(), llvm::Intrinsic::getType(), getTypeSizeInBits(), GroupByComplexity(), Idx, llvm::SmallVectorImpl< T >::insert(), M, llvm::SCEVNAryExpr::op_begin(), llvm::SCEVNAryExpr::op_end(), llvm::SmallVectorImpl< T >::push_back(), S, llvm::scAddExpr, llvm::scAddRecExpr, llvm::scMulExpr, llvm::SmallVectorImpl< T >::size(), T, and Ty.
Referenced by llvm::SCEVAddRecExpr::evaluateAtIteration(), ExposePointerBase(), FactorOutConstant(), getAddExpr(), getMinusSCEV(), getMulExpr(), llvm::SCEVAddRecExpr::getPostIncExpr(), getSCEVAtScope(), getSCEVStartAndStride(), getSignExtendExpr(), getUDivExpr(), getZeroExtendExpr(), MoveImmediateValues(), MoveLoopVariantsToImmediateField(), RemoveCommonExpressionsFromUseBases(), and SimplifyAddOperands().
Definition at line 399 of file ScalarEvolution.h.
References getAddExpr(), and llvm::SmallVectorImpl< T >::push_back().
| const SCEV* llvm::ScalarEvolution::getAddExpr | ( | const SCEV * | Op0, | |
| const SCEV * | Op1, | |||
| const SCEV * | Op2 | |||
| ) | [inline] |
Definition at line 405 of file ScalarEvolution.h.
References getAddExpr(), and llvm::SmallVectorImpl< T >::push_back().
| const SCEV * ScalarEvolution::getMulExpr | ( | SmallVectorImpl< const SCEV * > & | Ops | ) |
getMulExpr - Get a canonical multiply expression, or something simpler if possible.
Definition at line 1506 of file ScalarEvolution.cpp.
References llvm::FoldingSetNodeID::AddInteger(), llvm::FoldingSetNodeID::AddPointer(), llvm::BumpPtrAllocator::Allocate(), llvm::SmallVectorImpl< T >::begin(), llvm::SmallVectorImpl< T >::empty(), llvm::SmallVectorImpl< T >::end(), llvm::SmallVectorImpl< T >::erase(), G, llvm::ConstantInt::get(), getAddExpr(), getAddRecExpr(), getConstant(), getContext(), getEffectiveSCEVType(), llvm::SCEVAddRecExpr::getLoop(), llvm::SCEVNAryExpr::getNumOperands(), llvm::SCEVNAryExpr::getOperand(), llvm::SCEVAddRecExpr::getStart(), llvm::SCEVAddRecExpr::getStepRecurrence(), llvm::Intrinsic::getType(), GroupByComplexity(), Idx, llvm::SmallVectorImpl< T >::insert(), llvm::SmallVectorImpl< T >::push_back(), llvm::SmallVectorImpl< T >::reserve(), S, llvm::scAddRecExpr, Scale, llvm::scMulExpr, and llvm::SmallVectorImpl< T >::size().
Referenced by BinomialCoefficient(), CollectAddOperandsWithScales(), llvm::SCEVAddRecExpr::evaluateAtIteration(), FactorOutConstant(), getAddExpr(), getAllocSizeExpr(), getMulExpr(), getNegativeSCEV(), getSCEVAtScope(), getSignExtendExpr(), getUDivExpr(), getZeroExtendExpr(), and MoveImmediateValues().
Definition at line 414 of file ScalarEvolution.h.
References getMulExpr(), and llvm::SmallVectorImpl< T >::push_back().
getUDivExpr - Get a canonical unsigned division expression, or something simpler if possible.
Definition at line 1677 of file ScalarEvolution.cpp.
References A, llvm::FoldingSetNodeID::AddInteger(), llvm::FoldingSetNodeID::AddPointer(), llvm::BumpPtrAllocator::Allocate(), llvm::SmallVectorImpl< T >::begin(), llvm::SmallVectorImpl< T >::clear(), llvm::SmallVectorImpl< T >::end(), llvm::IntegerType::get(), getAddExpr(), getAddRecExpr(), getConstant(), getContext(), getEffectiveSCEVType(), getIntegerSCEV(), getMulExpr(), llvm::SCEV::getType(), getTypeSizeInBits(), llvm::ConstantExpr::getUDiv(), getZeroExtendExpr(), M, Op, llvm::SmallVectorImpl< T >::push_back(), S, llvm::scUDivExpr, llvm::SmallVectorImpl< T >::size(), and Ty.
Referenced by BinomialCoefficient(), and getSCEVAtScope().
| const SCEV * ScalarEvolution::getAddRecExpr | ( | const SCEV * | Start, | |
| const SCEV * | Step, | |||
| const Loop * | L | |||
| ) |
getAddRecExpr - Get an add recurrence expression for the specified loop. Simplify the expression as much as possible.
Definition at line 1777 of file ScalarEvolution.cpp.
References llvm::SmallVectorImpl< T >::end(), llvm::SmallVectorImpl< T >::insert(), and llvm::SmallVectorImpl< T >::push_back().
Referenced by ExposePointerBase(), FactorOutConstant(), getAddExpr(), getAddRecExpr(), getMulExpr(), llvm::SCEVAddRecExpr::getNumIterationsInRange(), llvm::SCEVExpander::getOrInsertCanonicalInductionVariable(), getSignExtendExpr(), llvm::SCEVAddRecExpr::getStepRecurrence(), getTruncateExpr(), getUDivExpr(), getZeroExtendExpr(), MoveImmediateValues(), MoveLoopVariantsToImmediateField(), SeparateSubExprs(), and SplitAddRecs().
| const SCEV * ScalarEvolution::getAddRecExpr | ( | SmallVectorImpl< const SCEV * > & | Operands, | |
| const Loop * | L | |||
| ) |
getAddRecExpr - Get an add recurrence expression for the specified loop. Simplify the expression as much as possible.
Definition at line 1795 of file ScalarEvolution.cpp.
References llvm::FoldingSetNodeID::AddInteger(), llvm::FoldingSetNodeID::AddPointer(), llvm::BumpPtrAllocator::Allocate(), llvm::SmallVectorImpl< T >::back(), getAddRecExpr(), getEffectiveSCEVType(), llvm::LoopBase< BlockT, LoopT >::getLoopDepth(), llvm::Intrinsic::getType(), llvm::SmallVectorImpl< T >::pop_back(), S, llvm::scAddRecExpr, and llvm::SmallVectorImpl< T >::size().
| const SCEV* llvm::ScalarEvolution::getAddRecExpr | ( | const SmallVectorImpl< const SCEV * > & | Operands, | |
| const Loop * | L | |||
| ) | [inline] |
Definition at line 425 of file ScalarEvolution.h.
References llvm::SmallVectorImpl< T >::begin(), llvm::SmallVectorImpl< T >::end(), and getAddRecExpr().
Definition at line 1857 of file ScalarEvolution.cpp.
References llvm::SmallVectorImpl< T >::push_back().
Referenced by getSCEVAtScope(), getSMaxExpr(), and getSMinExpr().
| const SCEV * ScalarEvolution::getSMaxExpr | ( | SmallVectorImpl< const SCEV * > & | Operands | ) |
Definition at line 1866 of file ScalarEvolution.cpp.
References llvm::FoldingSetNodeID::AddInteger(), llvm::BumpPtrAllocator::Allocate(), llvm::SmallVectorImpl< T >::begin(), llvm::SmallVectorImpl< T >::empty(), llvm::SmallVectorImpl< T >::end(), llvm::SmallVectorImpl< T >::erase(), llvm::ConstantInt::get(), getConstant(), getContext(), getEffectiveSCEVType(), getSMaxExpr(), llvm::Intrinsic::getType(), GroupByComplexity(), Idx, llvm::SmallVectorImpl< T >::insert(), S, llvm::scSMaxExpr, llvm::SmallVectorImpl< T >::size(), and llvm::APIntOps::smax().
Definition at line 1954 of file ScalarEvolution.cpp.
References llvm::SmallVectorImpl< T >::push_back().
Referenced by getSCEVAtScope(), getUMaxExpr(), getUMaxFromMismatchedTypes(), and getUMinExpr().
| const SCEV * ScalarEvolution::getUMaxExpr | ( | SmallVectorImpl< const SCEV * > & | Operands | ) |
Definition at line 1963 of file ScalarEvolution.cpp.
References llvm::FoldingSetNodeID::AddInteger(), llvm::BumpPtrAllocator::Allocate(), llvm::SmallVectorImpl< T >::begin(), llvm::SmallVectorImpl< T >::empty(), llvm::SmallVectorImpl< T >::end(), llvm::SmallVectorImpl< T >::erase(), llvm::ConstantInt::get(), getConstant(), getContext(), getEffectiveSCEVType(), llvm::Intrinsic::getType(), getUMaxExpr(), GroupByComplexity(), Idx, llvm::SmallVectorImpl< T >::insert(), S, llvm::scUMaxExpr, llvm::SmallVectorImpl< T >::size(), and llvm::APIntOps::umax().
Definition at line 2057 of file ScalarEvolution.cpp.
References getNotSCEV(), and getUMaxExpr().
Referenced by getUMinFromMismatchedTypes().
| const SCEV * ScalarEvolution::getFieldOffsetExpr | ( | const StructType * | STy, | |
| unsigned | FieldNo | |||
| ) |
Definition at line 2063 of file ScalarEvolution.cpp.
References llvm::FoldingSetNodeID::AddInteger(), llvm::FoldingSetNodeID::AddPointer(), llvm::BumpPtrAllocator::Allocate(), getContext(), getEffectiveSCEVType(), llvm::StructLayout::getElementOffset(), getIntegerSCEV(), llvm::TargetData::getIntPtrType(), llvm::TargetData::getStructLayout(), llvm::PointerType::getUnqual(), Offset, S, llvm::scFieldOffset, and Ty.
Definition at line 2094 of file ScalarEvolution.cpp.
References llvm::FoldingSetNodeID::AddInteger(), llvm::FoldingSetNodeID::AddPointer(), llvm::BumpPtrAllocator::Allocate(), E, llvm::ConstantInt::get(), getConstant(), getContext(), getEffectiveSCEVType(), getIntegerSCEV(), llvm::TargetData::getIntPtrType(), getMulExpr(), llvm::SCEV::getType(), llvm::TargetData::getTypeAllocSize(), llvm::PointerType::getUnqual(), llvm::Type::isSized(), S, llvm::scAllocSize, and Ty.
Definition at line 2133 of file ScalarEvolution.cpp.
References llvm::FoldingSetNodeID::AddInteger(), llvm::FoldingSetNodeID::AddPointer(), llvm::BumpPtrAllocator::Allocate(), S, and llvm::scUnknown.
| const SCEV * ScalarEvolution::getCouldNotCompute | ( | ) |
Definition at line 2200 of file ScalarEvolution.cpp.
Referenced by BinomialCoefficient(), llvm::SCEVAddRecExpr::getNumIterationsInRange(), getSCEVAtScope(), SolveLinEquationWithOverflow(), and SolveQuadraticEquation().
getNegativeSCEV - Return the SCEV object corresponding to -V.
getNegativeSCEV - Return a SCEV corresponding to -V = -1*V
Definition at line 2225 of file ScalarEvolution.cpp.
References llvm::Constant::getAllOnesValue(), getConstant(), getEffectiveSCEVType(), getMulExpr(), llvm::ConstantExpr::getNeg(), llvm::SCEV::getType(), Ty, and llvm::ARMCC::VC.
Referenced by getMinusSCEV(), llvm::SCEVAddRecExpr::getNumIterationsInRange(), and InsertAffinePhi().
getNotSCEV - Return a SCEV corresponding to ~V = -1-V
getNotSCEV - Return the SCEV object corresponding to ~V.
Definition at line 2237 of file ScalarEvolution.cpp.
References llvm::Constant::getAllOnesValue(), getConstant(), getEffectiveSCEVType(), getMinusSCEV(), llvm::ConstantExpr::getNot(), llvm::SCEV::getType(), Ty, and llvm::ARMCC::VC.
Referenced by getSMinExpr(), and getUMinExpr().
getMinusSCEV - Return LHS-RHS.
getMinusSCEV - Return a SCEV corresponding to LHS - RHS.
Definition at line 2251 of file ScalarEvolution.cpp.
References getAddExpr(), and getNegativeSCEV().
Referenced by llvm::IVUsers::AddUsersIfInteresting(), BinomialCoefficient(), getNotSCEV(), llvm::PointerTracking::getPointerOffset(), isKnownPredicate(), and RemoveCommonExpressionsFromUseBases().
getTruncateOrZeroExtend - Return a SCEV corresponding to a conversion of the input value to the specified type. If the type must be extended, it is zero extended.
getTruncateOrZeroExtend - Return a SCEV corresponding to a conversion of the input value to the specified type. If the type must be extended, it is zero extended.
Definition at line 2261 of file ScalarEvolution.cpp.
References getTruncateExpr(), llvm::SCEV::getType(), getTypeSizeInBits(), getZeroExtendExpr(), and llvm::Type::isInteger().
Referenced by BinomialCoefficient(), getSignExtendExpr(), getTruncateExpr(), and getZeroExtendExpr().
getTruncateOrSignExtend - Return a SCEV corresponding to a conversion of the input value to the specified type. If the type must be extended, it is sign extended.
getTruncateOrSignExtend - Return a SCEV corresponding to a conversion of the input value to the specified type. If the type must be extended, it is sign extended.
Definition at line 2278 of file ScalarEvolution.cpp.
References getSignExtendExpr(), getTruncateExpr(), llvm::SCEV::getType(), getTypeSizeInBits(), and llvm::Type::isInteger().
Referenced by getSignExtendExpr(), getTruncateExpr(), and getZeroExtendExpr().
getNoopOrZeroExtend - Return a SCEV corresponding to a conversion of the input value to the specified type. If the type must be extended, it is zero extended. The conversion must not be narrowing.
getNoopOrZeroExtend - Return a SCEV corresponding to a conversion of the input value to the specified type. If the type must be extended, it is zero extended. The conversion must not be narrowing.
Definition at line 2295 of file ScalarEvolution.cpp.
References llvm::SCEV::getType(), getTypeSizeInBits(), getZeroExtendExpr(), and llvm::Type::isInteger().
Referenced by getSignedRange(), getUMaxFromMismatchedTypes(), getUMinFromMismatchedTypes(), and getUnsignedRange().
getNoopOrSignExtend - Return a SCEV corresponding to a conversion of the input value to the specified type. If the type must be extended, it is sign extended. The conversion must not be narrowing.
getNoopOrSignExtend - Return a SCEV corresponding to a conversion of the input value to the specified type. If the type must be extended, it is sign extended. The conversion must not be narrowing.
Definition at line 2311 of file ScalarEvolution.cpp.
References getSignExtendExpr(), llvm::SCEV::getType(), getTypeSizeInBits(), and llvm::Type::isInteger().
getNoopOrAnyExtend - Return a SCEV corresponding to a conversion of the input value to the specified type. If the type must be extended, it is extended with unspecified bits. The conversion must not be narrowing.
getNoopOrAnyExtend - Return a SCEV corresponding to a conversion of the input value to the specified type. If the type must be extended, it is extended with unspecified bits. The conversion must not be narrowing.
Definition at line 2328 of file ScalarEvolution.cpp.
References getAnyExtendExpr(), llvm::SCEV::getType(), getTypeSizeInBits(), and llvm::Type::isInteger().
getTruncateOrNoop - Return a SCEV corresponding to a conversion of the input value to the specified type. The conversion must not be widening.
getTruncateOrNoop - Return a SCEV corresponding to a conversion of the input value to the specified type. The conversion must not be widening.
Definition at line 2343 of file ScalarEvolution.cpp.
References getTruncateExpr(), llvm::SCEV::getType(), getTypeSizeInBits(), and llvm::Type::isInteger().
Referenced by getAnyExtendExpr().
getIntegerSCEV - Given a SCEVable type, create a constant for the specified signed integer value and return a SCEV for the constant.
getIntegerSCEV - Given a SCEVable type, create a constant for the specified signed integer value and return a SCEV for the constant.
Definition at line 2218 of file ScalarEvolution.cpp.
References llvm::ConstantInt::get(), getConstant(), and getEffectiveSCEVType().
Referenced by llvm::IVUsers::AddUsersIfInteresting(), BinomialCoefficient(), ExposePointerBase(), FactorOutConstant(), getAddExpr(), getAllocSizeExpr(), getFieldOffsetExpr(), llvm::SCEVAddRecExpr::getNumIterationsInRange(), llvm::SCEVExpander::getOrInsertCanonicalInductionVariable(), getUDivExpr(), MoveImmediateValues(), MoveLoopVariantsToImmediateField(), RemoveCommonExpressionsFromUseBases(), SeparateSubExprs(), SimplifyAddOperands(), and SplitAddRecs().
getUMaxFromMismatchedTypes - Promote the operands to the wider of the types using zero-extension, and then perform a umax operation with them.
getUMaxFromMismatchedTypes - Promote the operands to the wider of the types using zero-extension, and then perform a umax operation with them.
Definition at line 2358 of file ScalarEvolution.cpp.
References getNoopOrZeroExtend(), llvm::SCEV::getType(), getTypeSizeInBits(), getUMaxExpr(), and getZeroExtendExpr().
getUMinFromMismatchedTypes - Promote the operands to the wider of the types using zero-extension, and then perform a umin operation with them.
getUMinFromMismatchedTypes - Promote the operands to the wider of the types using zero-extension, and then perform a umin operation with them.
Definition at line 2374 of file ScalarEvolution.cpp.
References getNoopOrZeroExtend(), llvm::SCEV::getType(), getTypeSizeInBits(), getUMinExpr(), and getZeroExtendExpr().
getSCEVAtScope - Return a SCEV expression handle for the specified value at the specified scope in the program. The L value specifies a loop nest to evaluate the expression at, where null is the top-level or a specified loop is immediately inside of the loop.
This method can be used to compute the exit value for a variable defined in a loop by querying what the value will hold in the parent loop.
In the case that a relevant loop exit value cannot be computed, the original value V is returned.
getSCEVAtScope - Return a SCEV expression handle for the specified value at the specified scope in the program. The L value specifies a loop nest to evaluate the expression at, where null is the top-level or a specified loop is immediately inside of the loop.
This method can be used to compute the exit value for a variable defined in a loop by querying what the value will hold in the parent loop.
In the case that a relevant loop exit value cannot be computed, the original value V is returned.
Definition at line 3901 of file ScalarEvolution.cpp.
References llvm::CallingConv::C, CanConstantFold(), llvm::ConstantFoldCompareInstOperands(), llvm::ConstantFoldInstOperands(), llvm::LoopBase< BlockT, LoopT >::contains(), getAddExpr(), getBackedgeTakenCount(), llvm::ConstantExpr::getCast(), llvm::CastInst::getCastOpcode(), getContext(), getCouldNotCompute(), llvm::LoopBase< BlockT, LoopT >::getHeader(), getMulExpr(), llvm::Instruction::getParent(), llvm::LoopBase< BlockT, LoopT >::getParentLoop(), getSCEV(), getSignExtendExpr(), getSMaxExpr(), getTruncateExpr(), llvm::SCEV::getType(), llvm::Value::getType(), getUDivExpr(), getUMaxExpr(), getZeroExtendExpr(), isSCEVable(), llvm_unreachable, Op, and Values.
Referenced by getSCEVAtScope(), getSCEVStartAndStride(), and print().
getSCEVAtScope - This is a convenience function which does getSCEVAtScope(getSCEV(V), L).
getSCEVAtScope - This is a convenience function which does getSCEVAtScope(getSCEV(V), L).
Definition at line 4084 of file ScalarEvolution.cpp.
References getSCEV(), and getSCEVAtScope().
| bool ScalarEvolution::isLoopGuardedByCond | ( | const Loop * | L, | |
| ICmpInst::Predicate | Pred, | |||
| const SCEV * | LHS, | |||
| const SCEV * | RHS | |||
| ) |
isLoopGuardedByCond - Test whether entry to the loop is protected by a conditional between LHS and RHS. This is used to help avoid max expressions in loop trip counts, and to eliminate casts.
isLoopGuardedByCond - Test whether entry to the loop is protected by a conditional between LHS and RHS. This is used to help avoid max expressions in loop trip counts, and to eliminate casts.
Definition at line 4487 of file ScalarEvolution.cpp.
References llvm::dyn_cast(), llvm::BranchInst::getCondition(), llvm::LoopBase< BlockT, LoopT >::getHeader(), llvm::BranchInst::getSuccessor(), and llvm::BranchInst::isUnconditional().
Referenced by getSignExtendExpr(), and getZeroExtendExpr().
| bool ScalarEvolution::isLoopBackedgeGuardedByCond | ( | const Loop * | L, | |
| ICmpInst::Predicate | Pred, | |||
| const SCEV * | LHS, | |||
| const SCEV * | RHS | |||
| ) |
isLoopBackedgeGuardedByCond - Test whether the backedge of the loop is protected by a conditional between LHS and RHS. This is used to to eliminate casts.
isLoopBackedgeGuardedByCond - Test whether the backedge of the loop is protected by a conditional between LHS and RHS. This is used to to eliminate casts.
Definition at line 4462 of file ScalarEvolution.cpp.
References llvm::dyn_cast(), llvm::BranchInst::getCondition(), llvm::LoopBase< BlockT, LoopT >::getHeader(), llvm::LoopBase< BlockT, LoopT >::getLoopLatch(), llvm::BranchInst::getSuccessor(), llvm::BasicBlock::getTerminator(), and llvm::BranchInst::isUnconditional().
Referenced by getSignExtendExpr(), and getZeroExtendExpr().
getBackedgeTakenCount - If the specified loop has a predictable backedge-taken count, return it, otherwise return a SCEVCouldNotCompute object. The backedge-taken count is the number of times the loop header will be branched to from within the loop. This is one less than the trip count of the loop, since it doesn't count the first iteration, when the header is branched to from outside the loop.
Note that it is not valid to call this method on a loop without a loop-invariant backedge-taken count (see hasLoopInvariantBackedgeTakenCount).
getBackedgeTakenCount - If the specified loop has a predictable backedge-taken count, return it, otherwise return a SCEVCouldNotCompute object. The backedge-taken count is the number of times the loop header will be branched to from within the loop. This is one less than the trip count of the loop, since it doesn't count the first iteration, when the header is branched to from outside the loop.
Note that it is not valid to call this method on a loop without a loop-invariant backedge-taken count (see hasLoopInvariantBackedgeTakenCount).
Definition at line 3162 of file ScalarEvolution.cpp.
Referenced by getSCEVAtScope(), getSignedRange(), getUnsignedRange(), hasLoopInvariantBackedgeTakenCount(), and PrintLoopInfo().
getMaxBackedgeTakenCount - Similar to getBackedgeTakenCount, except return the least SCEV value that is known never to be less than the actual backedge taken count.
getMaxBackedgeTakenCount - Similar to getBackedgeTakenCount, except return the least SCEV value that is known never to be less than the actual backedge taken count.
Definition at line 3169 of file ScalarEvolution.cpp.
Referenced by getSignedRange(), getSignExtendExpr(), getUnsignedRange(), getZeroExtendExpr(), and PrintLoopInfo().
hasLoopInvariantBackedgeTakenCount - Return true if the specified loop has an analyzable loop-invariant backedge-taken count.
Definition at line 5118 of file ScalarEvolution.cpp.
References getBackedgeTakenCount().
Referenced by PrintLoopInfo().
| void ScalarEvolution::forgetLoopBackedgeTakenCount | ( | const Loop * | L | ) |
forgetLoopBackedgeTakenCount - This method should be called by the client when it has changed a loop in a way that may effect ScalarEvolution's ability to compute a trip count, or if the loop is deleted.
forgetLoopBackedgeTakenCount - This method should be called by the client when it has changed a loop in a way that may effect ScalarEvolution's ability to compute a trip count, or if the loop is deleted.
Definition at line 3255 of file ScalarEvolution.cpp.
References llvm::SmallVectorImpl< T >::empty(), llvm::SmallPtrSet< PtrType, SmallSize >::insert(), llvm::SmallVectorImpl< T >::pop_back_val(), PushDefUseChildren(), and PushLoopPHIs().
| uint32_t ScalarEvolution::GetMinTrailingZeros | ( | const SCEV * | S | ) |
GetMinTrailingZeros - Determine the minimum number of zero bits that S is guaranteed to end in (at every loop iteration). It is, at the same time, the minimum number of times S is divisible by 2. For example, given {4,+,8} it returns 2. If S is guaranteed to be 0, it returns the bitwidth of S.
GetMinTrailingZeros - Determine the minimum number of zero bits that S is guaranteed to end in (at every loop iteration). It is, at the same time, the minimum number of times S is divisible by 2. For example, given {4,+,8} it returns 2. If S is guaranteed to be 0, it returns the bitwidth of S.
Definition at line 2600 of file ScalarEvolution.cpp.
References A, llvm::CallingConv::C, llvm::ComputeMaskedBits(), E, llvm::APInt::getAllOnesValue(), getTypeSizeInBits(), M, and T.
| ConstantRange ScalarEvolution::getUnsignedRange | ( | const SCEV * | S | ) |
getUnsignedRange - Determine the unsigned range for a particular SCEV.
Definition at line 2679 of file ScalarEvolution.cpp.
References llvm::ConstantRange::add(), llvm::CallingConv::C, llvm::ComputeMaskedBits(), llvm::dyn_cast(), End, llvm::APInt::getAllOnesValue(), getBackedgeTakenCount(), getMaxBackedgeTakenCount(), getNoopOrZeroExtend(), llvm::User::getOperand(), llvm::SCEV::getType(), llvm::Value::getType(), getTypeSizeInBits(), llvm::ConstantRange::getUnsignedMax(), llvm::ConstantRange::getUnsignedMin(), llvm::CmpInst::ICMP_UGT, llvm::CmpInst::ICMP_ULT, llvm::SCEV::isAllOnesValue(), isKnownPredicate(), llvm::APInt::isMinValue(), llvm::SCEV::isOne(), llvm::ConstantRange::multiply(), llvm::Attribute::SExt, llvm::ConstantRange::signExtend(), llvm::ConstantRange::smax(), Start, T, llvm::ConstantRange::truncate(), Ty, llvm::ConstantRange::udiv(), llvm::APIntOps::umax(), llvm::ConstantRange::umax(), llvm::APIntOps::umin(), llvm::X, Y, llvm::ConstantRange::zeroExtend(), and llvm::ZExt.
Referenced by getZeroExtendExpr(), and isKnownPredicate().
| ConstantRange ScalarEvolution::getSignedRange | ( | const SCEV * | S | ) |
getSignedRange - Determine the signed range for a particular SCEV.
Definition at line 2789 of file ScalarEvolution.cpp.
References llvm::ConstantRange::add(), llvm::APIntOps::ashr(), llvm::CallingConv::C, llvm::ComputeNumSignBits(), llvm::dyn_cast(), End, getBackedgeTakenCount(), getMaxBackedgeTakenCount(), getNoopOrZeroExtend(), llvm::User::getOperand(), llvm::ConstantRange::getSignedMax(), llvm::APInt::getSignedMaxValue(), llvm::ConstantRange::getSignedMin(), llvm::APInt::getSignedMinValue(), llvm::SCEV::getType(), llvm::Value::getType(), getTypeSizeInBits(), llvm::CmpInst::ICMP_SGT, llvm::CmpInst::ICMP_SLT, llvm::SCEV::isAllOnesValue(), isKnownPredicate(), llvm::APInt::isMinSignedValue(), llvm::SCEV::isOne(), llvm::ConstantRange::multiply(), llvm::Attribute::SExt, llvm::ConstantRange::signExtend(), llvm::APIntOps::smax(), llvm::ConstantRange::smax(), llvm::APIntOps::smin(), Start, T, llvm::ConstantRange::truncate(), Ty, llvm::ConstantRange::udiv(), llvm::ConstantRange::umax(), llvm::X, Y, llvm::ConstantRange::zeroExtend(), and llvm::ZExt.
Referenced by getSignExtendExpr(), getZeroExtendExpr(), isKnownNegative(), isKnownNonNegative(), isKnownNonPositive(), isKnownPositive(), and isKnownPredicate().
isKnownNegative - Test if the given expression is known to be negative.
Definition at line 4361 of file ScalarEvolution.cpp.
References llvm::ConstantRange::getSignedMax(), getSignedRange(), and llvm::APInt::isNegative().
Referenced by getSignExtendExpr(), getZeroExtendExpr(), and isKnownNonZero().
isKnownPositive - Test if the given expression is known to be positive.
Definition at line 4365 of file ScalarEvolution.cpp.
References llvm::ConstantRange::getSignedMin(), getSignedRange(), and llvm::APInt::isStrictlyPositive().
Referenced by getSignExtendExpr(), getZeroExtendExpr(), and isKnownNonZero().
isKnownNonNegative - Test if the given expression is known to be non-negative.
Definition at line 4369 of file ScalarEvolution.cpp.
References llvm::ConstantRange::getSignedMin(), getSignedRange(), and llvm::APInt::isNegative().
isKnownNonPositive - Test if the given expression is known to be non-positive.
Definition at line 4373 of file ScalarEvolution.cpp.
References llvm::ConstantRange::getSignedMax(), getSignedRange(), and llvm::APInt::isStrictlyPositive().
isKnownNonZero - Test if the given expression is known to be non-zero.
Definition at line 4377 of file ScalarEvolution.cpp.
References isKnownNegative(), and isKnownPositive().
Referenced by isKnownPredicate().
| bool ScalarEvolution::isKnownPredicate | ( | ICmpInst::Predicate | Pred, | |
| const SCEV * | LHS, | |||
| const SCEV * | RHS | |||
| ) |
isKnownNonZero - Test if the given expression is known to satisfy the condition described by Pred, LHS, and RHS.
Definition at line 4381 of file ScalarEvolution.cpp.
References getMinusSCEV(), llvm::ConstantRange::getSignedMax(), llvm::ConstantRange::getSignedMin(), getSignedRange(), llvm::ConstantRange::getUnsignedMax(), llvm::ConstantRange::getUnsignedMin(), getUnsignedRange(), HasSameValue(), 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, llvm::ConstantRange::intersectWith(), llvm::ConstantRange::isEmptySet(), isKnownNonZero(), llvm::ISD::isTrueWhenEqual(), llvm_unreachable, llvm::APInt::sge(), llvm::APInt::sgt(), llvm::APInt::sle(), llvm::APInt::slt(), std::swap(), llvm::APInt::uge(), llvm::APInt::ugt(), llvm::APInt::ule(), and llvm::APInt::ult().
Referenced by getSignedRange(), and getUnsignedRange().
runOnFunction - Virtual method overriden by subclasses to do the per-function processing of the pass.
Implements llvm::FunctionPass.
Definition at line 5097 of file ScalarEvolution.cpp.
| void ScalarEvolution::releaseMemory | ( | ) | [virtual] |
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memory when it is no longer needed. The default behavior of passes is to hold onto memory for the entire duration of their lifetime (which is the entire compile time). For pipelined passes, this is not a big deal because that memory gets recycled every time the pass is invoked on another program unit. For IP passes, it is more important to free memory when it is unused.
Optionally implement this function to release pass memory when it is no longer used.
Reimplemented from llvm::Pass.
Definition at line 5104 of file ScalarEvolution.cpp.
References llvm::BumpPtrAllocator::Reset().
| void ScalarEvolution::getAnalysisUsage | ( | AnalysisUsage & | ) | const [virtual] |
getAnalysisUsage - This function should be overriden by passes that need analysis information to do their job. If a pass specifies that it uses a particular analysis result to this function, it can then use the getAnalysis<AnalysisType>() function, below.
Reimplemented from llvm::Pass.
Definition at line 5113 of file ScalarEvolution.cpp.
References llvm::AnalysisUsage::addRequiredTransitive(), and llvm::AnalysisUsage::setPreservesAll().
| void ScalarEvolution::print | ( | raw_ostream & | OS, | |
| const Module * | = 0 | |||
| ) | const |
Definition at line 5153 of file ScalarEvolution.cpp.
References E, llvm::Value::getName(), llvm::LoopBase< BlockT, LoopT >::getParentLoop(), getSCEV(), getSCEVAtScope(), llvm::inst_begin(), llvm::inst_end(), llvm::SCEV::isLoopInvariant(), isSCEVable(), llvm::SCEV::print(), PrintLoopInfo(), and SE.
Referenced by print().
| void ScalarEvolution::print | ( | std::ostream & | O, | |
| const Module * | M = 0 | |||
| ) | const [virtual] |
print - Print out the internal state of the pass. This is called by Analyze to print out the contents of an analysis. Otherwise it is not necessary to implement this method. Beware that the module pointer MAY be null. This automatically forwards to a virtual function that does not provide the Module* in case the analysis doesn't need it it can just be ignored.
Reimplemented from llvm::Pass.
Definition at line 5196 of file ScalarEvolution.cpp.
| void llvm::ScalarEvolution::print | ( | std::ostream * | OS, | |
| const Module * | M = 0 | |||
| ) | const [inline] |
friend class SCEVCallbackVH [friend] |
friend struct SCEVExpander [friend] |
Definition at line 170 of file ScalarEvolution.h.
char ScalarEvolution::ID = 0 [static] |