diff options
author | Dan Gohman <gohman@apple.com> | 2010-06-24 16:45:11 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-06-24 16:45:11 +0000 |
commit | ab5422200b9a74fd6bf05eef07e4612c7a8b91c4 (patch) | |
tree | f94bb34aa4669a120e2d15c5a16262ed95b80f1f /llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp | |
parent | b13ddbada16b724ff911fbbf01b71b566283cc66 (diff) | |
download | bcm5719-llvm-ab5422200b9a74fd6bf05eef07e4612c7a8b91c4.tar.gz bcm5719-llvm-ab5422200b9a74fd6bf05eef07e4612c7a8b91c4.zip |
Fix copy+pasto issues in isMulSExtable.
llvm-svn: 106759
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp index e8da89a12cd..9982f1d71f6 100644 --- a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -392,12 +392,13 @@ static bool isAddSExtable(const SCEVAddExpr *A, ScalarEvolution &SE) { return isa<SCEVAddExpr>(SE.getSignExtendExpr(A, WideTy)); } -/// isMulSExtable - Return true if the given add can be sign-extended +/// isMulSExtable - Return true if the given mul can be sign-extended /// without changing its value. -static bool isMulSExtable(const SCEVMulExpr *A, ScalarEvolution &SE) { +static bool isMulSExtable(const SCEVMulExpr *M, ScalarEvolution &SE) { const Type *WideTy = - IntegerType::get(SE.getContext(), SE.getTypeSizeInBits(A->getType()) + 1); - return isa<SCEVMulExpr>(SE.getSignExtendExpr(A, WideTy)); + IntegerType::get(SE.getContext(), + SE.getTypeSizeInBits(M->getType()) * M->getNumOperands()); + return isa<SCEVMulExpr>(SE.getSignExtendExpr(M, WideTy)); } /// getExactSDiv - Return an expression for LHS /s RHS, if it can be determined |