Add ComputeMultiple() analysis function that recursively determines if a Value V is a multiple of unsigned Base

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86675 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Victor Hernandez
2009-11-10 08:28:35 +00:00
parent 8fb02511d2
commit 2b6705f5e7
2 changed files with 134 additions and 0 deletions

View File

@ -63,6 +63,15 @@ namespace llvm {
unsigned ComputeNumSignBits(Value *Op, const TargetData *TD = 0,
unsigned Depth = 0);
/// ComputeMultiple - This function computes the integer multiple of Base that
/// equals V. If successful, it returns true and returns the multiple in
/// Multiple. If unsuccessful, it returns false. Also, if V can be
/// simplified to an integer, then the simplified V is returned in Val. Look
/// through sext only if LookThroughSExt=true.
bool ComputeMultiple(Value *V, unsigned Base, Value *&Multiple, APInt &Val,
bool LookThroughSExt = false, const TargetData *TD = 0,
unsigned Depth = 0);
/// CannotBeNegativeZero - Return true if we can prove that the specified FP
/// value is never equal to -0.0.
///