summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2011-10-26 20:55:21 +0000
committerDuncan Sands <baldrick@free.fr>2011-10-26 20:55:21 +0000
commitdd3149d57977d0632cfaf24290dd93416fb2a0ef (patch)
tree474b791ded4b0b4e186663009e133000d2c45814 /include
parent1832f4d94eb292d63824eaa043118ed6cc61389b (diff)
downloadllvm-dd3149d57977d0632cfaf24290dd93416fb2a0ef.tar.gz
llvm-dd3149d57977d0632cfaf24290dd93416fb2a0ef.tar.bz2
llvm-dd3149d57977d0632cfaf24290dd93416fb2a0ef.tar.xz
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')
-rw-r--r--include/llvm/Analysis/ValueTracking.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/llvm/Analysis/ValueTracking.h b/include/llvm/Analysis/ValueTracking.h
index 68263300c7..6f82b2cd98 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