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 | 62167b95162a6b06e48619b8d4d4c80fb363e5f2 (patch) | |
tree | f71a2e0ef6f97e708c316f4dd9d71e4b81b94a72 /llvm/lib/Analysis/LoopInfo.cpp | |
parent | ee9067c51fef4cfa015539574cd9b93ebe7d2656 (diff) | |
download | bcm5719-llvm-62167b95162a6b06e48619b8d4d4c80fb363e5f2.tar.gz bcm5719-llvm-62167b95162a6b06e48619b8d4d4c80fb363e5f2.zip |
Teach getSmallConstantTripMultiple about Shl operators.
llvm-svn: 89426
Diffstat (limited to 'llvm/lib/Analysis/LoopInfo.cpp')
-rw-r--r-- | llvm/lib/Analysis/LoopInfo.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/LoopInfo.cpp b/llvm/lib/Analysis/LoopInfo.cpp index 1c614b0e06b..4de756c41b0 100644 --- a/llvm/lib/Analysis/LoopInfo.cpp +++ b/llvm/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; } |