aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Analysis/ScalarEvolution.h
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-06-19 23:29:04 +0000
committerDan Gohman <gohman@apple.com>2009-06-19 23:29:04 +0000
commit2c364ad4a65737f3bda876f86eba0061ecbd5470 (patch)
tree34d28bf8662f5c71871e6f924b2945567d82103e /include/llvm/Analysis/ScalarEvolution.h
parent2781f30eac8647552638246c28ab07dd0fc2c560 (diff)
downloadexternal_llvm-2c364ad4a65737f3bda876f86eba0061ecbd5470.zip
external_llvm-2c364ad4a65737f3bda876f86eba0061ecbd5470.tar.gz
external_llvm-2c364ad4a65737f3bda876f86eba0061ecbd5470.tar.bz2
Make GetMinTrailingZeros a member function of ScalarEvolution,
so that it can access the TargetData member (when available) and use ValueTracking.h information to compute information for SCEVUnknown Values. Also add GetMinLeadingZeros and GetMinSignBits functions, with minimal implementations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73794 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/ScalarEvolution.h')
-rw-r--r--include/llvm/Analysis/ScalarEvolution.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/llvm/Analysis/ScalarEvolution.h b/include/llvm/Analysis/ScalarEvolution.h
index 8c64366..211c0ca 100644
--- a/include/llvm/Analysis/ScalarEvolution.h
+++ b/include/llvm/Analysis/ScalarEvolution.h
@@ -571,6 +571,20 @@ namespace llvm {
/// is deleted.
void forgetLoopBackedgeTakenCount(const Loop *L);
+ /// 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.
+ uint32_t GetMinTrailingZeros(const SCEVHandle &S);
+
+ /// GetMinLeadingZeros - Determine the minimum number of zero bits that S is
+ /// guaranteed to begin with (at every loop iteration).
+ uint32_t GetMinLeadingZeros(const SCEVHandle &S);
+
+ /// GetMinSignBits - Determine the minimum number of sign bits that S is
+ /// guaranteed to begin with.
+ uint32_t GetMinSignBits(const SCEVHandle &S);
+
virtual bool runOnFunction(Function &F);
virtual void releaseMemory();
virtual void getAnalysisUsage(AnalysisUsage &AU) const;