summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/LoopInfo.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-11-20 01:09:34 +0000
committerDan Gohman <gohman@apple.com>2009-11-20 01:09:34 +0000
commit62167b95162a6b06e48619b8d4d4c80fb363e5f2 (patch)
treef71a2e0ef6f97e708c316f4dd9d71e4b81b94a72 /llvm/lib/Analysis/LoopInfo.cpp
parentee9067c51fef4cfa015539574cd9b93ebe7d2656 (diff)
downloadbcm5719-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.cpp5
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;
}
OpenPOWER on IntegriCloud