diff options
author | Duncan Sands <baldrick@free.fr> | 2011-10-26 20:55:21 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2011-10-26 20:55:21 +0000 |
commit | dd3149d57977d0632cfaf24290dd93416fb2a0ef (patch) | |
tree | 474b791ded4b0b4e186663009e133000d2c45814 /include/llvm/Analysis | |
parent | 1832f4d94eb292d63824eaa043118ed6cc61389b (diff) | |
download | external_llvm-dd3149d57977d0632cfaf24290dd93416fb2a0ef.zip external_llvm-dd3149d57977d0632cfaf24290dd93416fb2a0ef.tar.gz external_llvm-dd3149d57977d0632cfaf24290dd93416fb2a0ef.tar.bz2 |
The maximum power of 2 dividing a power of 2 is itself. This occurs
in 403.gcc and was spotted by my super-optimizer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143054 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis')
-rw-r--r-- | include/llvm/Analysis/ValueTracking.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/llvm/Analysis/ValueTracking.h b/include/llvm/Analysis/ValueTracking.h index 6826330..6f82b2c 100644 --- a/include/llvm/Analysis/ValueTracking.h +++ b/include/llvm/Analysis/ValueTracking.h @@ -48,8 +48,10 @@ namespace llvm { /// isPowerOfTwo - Return true if the given value is known to have exactly one /// bit set when defined. For vectors return true if every element is known to /// be a power of two when defined. Supports values with integer or pointer - /// type and vectors of integers. - bool isPowerOfTwo(Value *V, const TargetData *TD = 0, unsigned Depth = 0); + /// type and vectors of integers. If 'OrZero' is set then returns true if the + /// given value is either a power of two or zero. + bool isPowerOfTwo(Value *V, const TargetData *TD = 0, bool OrZero = false, + unsigned Depth = 0); /// isKnownNonZero - Return true if the given value is known to be non-zero /// when defined. For vectors return true if every element is known to be |