summaryrefslogtreecommitdiff
path: root/include/llvm/Analysis/ValueTracking.h
diff options
context:
space:
mode:
authorVictor Hernandez <vhernandez@apple.com>2009-11-10 08:28:35 +0000
committerVictor Hernandez <vhernandez@apple.com>2009-11-10 08:28:35 +0000
commit2b6705f5e7c7624bd7fe486298c400f1afc15f6c (patch)
treed13ce0c03ff993d45f08259c4455ef91638477ee /include/llvm/Analysis/ValueTracking.h
parent8fb02511d239594528ca791b92f2b92cabea78c3 (diff)
downloadllvm-2b6705f5e7c7624bd7fe486298c400f1afc15f6c.tar.gz
llvm-2b6705f5e7c7624bd7fe486298c400f1afc15f6c.tar.bz2
llvm-2b6705f5e7c7624bd7fe486298c400f1afc15f6c.tar.xz
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
Diffstat (limited to 'include/llvm/Analysis/ValueTracking.h')
-rw-r--r--include/llvm/Analysis/ValueTracking.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/llvm/Analysis/ValueTracking.h b/include/llvm/Analysis/ValueTracking.h
index f233608324..a7a078fa35 100644
--- a/include/llvm/Analysis/ValueTracking.h
+++ b/include/llvm/Analysis/ValueTracking.h
@@ -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.
///