diff options
author | Dan Gohman <gohman@apple.com> | 2009-11-20 01:09:34 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-11-20 01:09:34 +0000 |
commit | ac146657fc2dc63e9856e0090fd0bec4ba9befd3 (patch) | |
tree | 9307c0d5c124bd30cf40070137d5123419722b5d /lib/Analysis/LoopInfo.cpp | |
parent | 9ef4835bd879e1baa5f59619b958cae57d516481 (diff) | |
download | external_llvm-ac146657fc2dc63e9856e0090fd0bec4ba9befd3.tar.gz external_llvm-ac146657fc2dc63e9856e0090fd0bec4ba9befd3.tar.bz2 external_llvm-ac146657fc2dc63e9856e0090fd0bec4ba9befd3.zip |
Teach getSmallConstantTripMultiple about Shl operators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89426 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/LoopInfo.cpp')
-rw-r--r-- | lib/Analysis/LoopInfo.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Analysis/LoopInfo.cpp b/lib/Analysis/LoopInfo.cpp index 1c614b0e06..4de756c41b 100644 --- a/lib/Analysis/LoopInfo.cpp +++ b/lib/Analysis/LoopInfo.cpp @@ -243,6 +243,11 @@ unsigned Loop::getSmallConstantTripMultiple() const { case BinaryOperator::Mul: Result = dyn_cast<ConstantInt>(BO->getOperand(1)); break; + case BinaryOperator::Shl: + if (ConstantInt *CI = dyn_cast<ConstantInt>(BO->getOperand(1))) + if (CI->getValue().getActiveBits() <= 5) + return 1u << CI->getZExtValue(); + break; default: break; } |